Commit Graph
48 Commits
Author SHA1 Message Date
Jan Henning 5987351cb3 Bug 1342820 - Reset navigation button state when clearing history. r=ahunt
Clearing history purges a tab's session history as well. Normally, we only update the navigation button state in the UI for a location change, so now we need to start listening for the appropriate message as well.

BrowserApp has already registered a background thread listener for "Sanitize:ClearHistory" - since this can be called during shutdown as well and their listener is more important (clearing the history DB), we defer to them and redispatch to the UI thread ourselves, so BrowserApp doesn't have to do this during shutdown.

MozReview-Commit-ID: C83mk6Z56Oq
2017-03-01 21:08:11 +01:00
Dale Harvey b87295edb9 Bug 1321320 - Track installed manifests. r=marcos, r=s.kaspari 2017-02-17 08:24:06 +00:00
Jan Henning db19f40f8a Bug 1269210 - Part 2 - Notify the UI to update the button state on subframe navigation. r=ahunt
Even if we do the rest of our location change processing only for top level location changes, we still need to update the state of the back and forward buttons even on subframe navigation, so they can become enabled/disabled as necessary.

MozReview-Commit-ID: 2wuFZMKtTfj
2017-02-11 20:32:32 +01:00
Nevin Chen e8796c5cf9 Bug 1275662 - Close all tabs and clean up session files when "Open Tabs" is selected in "Clear private data on exit" or "Clear private data" pref. r=JanH,sebastian
MozReview-Commit-ID: GoUQVDIzYbI
2016-12-29 14:22:45 +08:00
Dylan Roeh fb5d7b143d Bug 1303362 - Set a flag on custom tabs so that links do not open in a new tab. r=snorp 2017-01-19 09:18:40 -06:00
Jim Chen 33ac7907b5 Bug 1329268 - 3. Convert Tabs observers to events; r=sebastian
Convert the "Tab:*" observers in browser.js, which go through the observer
service, to events that go through GlobalEventDispatcher.

FindHelper.js uses "Tab:Selected" through a lazy loader, but I don't
think FindHelper should listen to "Tab:Selected" at all until it is
being used. THerefore, this patch adds "Tab:Selected" registration to
FindHelper.js itself.
2017-01-17 20:06:08 -05:00
Jim Chen 0fe17e850c Bug 1329268 - 2. Convert Tabs events to bundle events; r=sebastian
Convert events used in Tabs to GeckoBundle/BundleEventListener events.

All of the events are converted to UI thread events, because a lot of
the listeners modify states in Tab (e.g. through
`Tab.handleLocationChange()`), and those states are later accessed on
the UI thread. We used to modify the states on the Gecko thread, and
then access them on the UI thread, which introduces potential race
conditions. Therefore, I think it's best to convert these events
wholesale to UI thread events to avoid races.

Tabs.notifyListeners now calls the listeners directly if it's already on
the UI thread, instead of posting to the UI thread again. This is meant
as an optimization because the events are now coming in on the UI thread
already.

The "Tab:SelectAndForeground" and "Tab:Select" events are merged into
one "Tab:Select" event, and a "foreground" option is added.

The "Tab:StreamStart" and "Tab:StreamStop" events are merged into one
"Tab:RecordingChange" event, and a "recording" option is added to
indicate starting or stopping.
2017-01-17 20:06:07 -05:00
Dale Harvey daf3f9c959 Bug 1234558 - Use icons from app manifest. r=marcosc, r=sebastian 2017-01-17 18:24:53 +00:00
Jan Henning 3918eec784 Bug 1301160 - Part 3 - Pass the saved parent tab ID when restoring tabs. r=sebastian
When restoring recently closed tabs during a browsing session, we can just pass the stored parentId as a parameter to addTab and be done with it.

During startup however, we first need to update the parent tab IDs before being able to use it.

At the moment, new tabs are always opened at the end of the tab list and cannot be resorted by the user, so child tabs always appear *after* their parent tabs in the tab list. However because we don't want to rely on this behaviour, we still need to collect a complete mapping between old and new tab IDs first before being able to update the stored parent tab IDs.

Therefore we cannot use the usual method of passing in the parentId during tab creation and have to set it after the fact for this case.

MozReview-Commit-ID: JT5YSkuOSZw
2017-01-07 22:26:36 +01:00
Jim Chen 5a3f21320a Bug 1321418 - Use GekcoBundle events in GeckoApp/BrowserApp; r=snorp r=sebastian r=gbrown
Bug 1321418 - 1. Use GekcoBundle events in GeckoApp; r=snorp r=sebastian

Switch GeckoApp to using GeckoBundle events everywhere. UI or Gecko
events are used if the event requires the UI or Gecko thread,
respectively, and background events are used for all other events.

There are changes to some other Java classes, such as SnackbarBuilder
and GeckoAccessibility, due to the switch to GeckoBundle.

For "Snackbar:Show", we need the global EventDispatcher because the
event can be sent to both GeckoApp and GeckoPreferences. Howveer, we
only want one listener registered at the same time, so we register and
unregister in GeckoApp's and GeckoPreferences's onPause and onResume
methods.

Bug 1321418 - 2. Use appropriate JS EventDispatcher to send GeckoApp events; r=snorp r=sebastian

Change JS code that sends events to GeckoApp to use either the global
EventDispatcher or the per-window EventDispatcher.

"Session:StatePurged" is not used so it's removed. "Gecko:Ready" in
geckoview.js is not necessary because it's only used for GeckoApp, so
it's removed from geckoview.js.

Bug 1321418 - 3. Use GeckoBundle events in BrowserApp; r=snorp r=sebastian

Switch BrowserApp to using GeckoBundle events, in a similar vein as
GeckoApp. UI or Gecko events are used if the event handlers required UI
or Gecko thread, respectively, and background events are used for all
other events.

Some other Java classes also have to be modified as a result of
switching to GeckoBundle.

Bug 1321418 - 4. Use global EventDispatcher to send BrowserApp events; r=snorp r=sebastian

Change JS code that sends events to BrowserApp to use the global
EventDispatcher instead of "Messaging".

Bug 1321418 - 5. Update usages of events in tests; r=gbrown

Update cases where we use or wait for events in tests.
2016-12-09 12:32:45 -05:00
Dylan Roeh b17dbbcea3 Bug 1235431 - Implement windowClient.focus() for Fennec. r=catalinb 2016-11-14 17:22:13 -06:00
Tom Klein 0279ab60e9 Bug 1302936 - Ignore tab clicks when the tab has already been removed. r=sebastian
MozReview-Commit-ID: K0eUnMHI9j1
2016-11-12 09:09:17 -06:00
Alastor Wu 5aac7cb98b Bug 1302453 - part2 : notify MediaControlService when the media is resumed. r=sebastian
When user resumes media from the page, we should notify MediaControlService so
that it can change the playing icon to the correct status.

MozReview-Commit-ID: 15e2GrxvB6a
2016-10-27 10:00:25 +08:00
Tom Klein e776e8133e Bug 1116415 - 5. Send the index of an added tab as data. r=sebastian
Use the index in TabsLayout to specify where a tab was inserted instead of just
replacing the entire tabs list on a tab add.

MozReview-Commit-ID: Feft0RlN97r
2016-10-13 10:26:53 -05:00
Tushar Saini (:shatur) 75462f42df Bug 1261041 - Remove feature11Plus-feature15Plus flags. r=sebastian
MozReview-Commit-ID: J4uXtUrjuKr
2016-09-22 21:20:23 +05:30
Dylan Roeh 45a079c5d5 Bug 1294821 - De-singletonize EventDispatcher and make it application-specific. r=jchen 2016-09-27 11:07:24 -05:00
Jim Chen 44870b81a5 Bug 1291384 - 2. Convert GeckoProfile.getDB calls to BrowserDB.from calls; r=nalexander
Mass convert GeckoProfile.getDB() calls to BrowserDB.from() calls,
whether using Context or GeckoProfile.
2016-09-14 12:46:50 -04:00
Jim Chen 44c72cf571 Bug 1258470 - 1. Remove RTL and ZoomConstraints variables from gfx; r=rbarker
We no longer send viewport metadata, so we don't actually make use of
the RTL and ZoomConstraints variables we keep in Java. There is a single
usage of an RTL flag in ImmutableViewportMetrics.offsetViewportByAndClamp,
but I think the two branches are equivalent, so the RTL flag is not needed
there either.
2016-09-14 12:43:35 -04:00
Alastor Wu 9ef6e819ba Bug 1290467 - part3 : notify MediaControlService with event 'MEDIA_PLAYING_CHANGE'. r=sebastian
The 'MEDIA_PLAYING_CHANGE' is used for controling media control interface and
the 'AUDIO_PLAYING_CHANGE' is used for showing the tab sound indicator.

MozReview-Commit-ID: 8hZjC77Ju71
2016-09-09 09:50:25 +08:00
Jan Henning 3a00023cb5 Bug 1299576 - Part 2 - Cancel edit mode when restoring a recently closed tab. r=sebastian
When restoring a recently closed tab from the corresponding home panel, we normally directly switch to the freshly recreated tab. However if we've entered the home panels through editing mode (as opposed to opening a new tab with about:home), editing mode takes priority and the restored tab is opened in background instead, because we return to the originally selected tab when exiting editing mode.

To fix this inconsistency, we introduce a new parameter for opening tabs from Gecko that cancels editing mode if necessary to allow for directly switching to the new tab.

MozReview-Commit-ID: 4iqPISmtNIx
2016-09-02 20:43:08 +02:00
Randall Barker 3614e2f9a5 Bug 1299922 - Keep surface covered until it has been painted when switching tabs in Fennec r=jchen 2016-09-06 18:01:36 -07:00
Randall Barker 073f710cca Bug 1297853 - White flash when creating a private browsing tab r=jchen,kats 2016-09-06 18:01:36 -07:00
Andrzej Hunt 44d851f606 Bug 1297117 - Replace unnecessary usage of getUrlFromAboutReader with stripAboutReaderUrl r=sebastian
In some of these cases we're duplicating the work of stripAboutReaderUrl. In the other cases
there is no effective difference, however switching to stripAboutReaderUrl allows us
to make getUrlFromAboutReader private, which should help prevent future errors.

MozReview-Commit-ID: BLeQkve2XIs
2016-09-05 12:56:49 -07:00
Sebastian Kaspari 71e2051ab1 Bug 1290014 - Use new icon framework in UI code. r=ahunt,Grisha
This patch replaces the old favicon code with the new icon code
in the UI code.

MozReview-Commit-ID: 2YdDpYUhb0M
2016-08-16 11:44:21 +02:00
Randall Barker 8205a50286 Bug 1297850 - part 2, Background is no longer cleared by Java. Remove unused setBackgroundColor. r=jchen 2016-08-25 17:26:42 -07:00
Wes Kocher 0003442039 Backed out 2 changesets (bug 1297850) for robocop bustage a=backout CLOSED TREE
Backed out changeset e83c9eb279a9 (bug 1297850)
Backed out changeset 979694026137 (bug 1297850)
2016-08-25 11:29:35 -07:00
Randall Barker fddb74e6a6 Bug 1297850 - part 2, Background is no longer cleared by Java. Remove unused setBackgroundColor. r=jchen 2016-08-25 08:14:52 -07:00
Geoff Brown 9134a27a21 Bug 1271104 - Avoid menu selection in robocop testPrivateBrowsing; r=sebastian 2016-08-22 13:51:31 -06:00
Sebastian Kaspari 0ac1498989 Bug 1261008 - Do not restore tabs pointing to about:home and with no history. r=janh,ahunt
If the browser is set to always restore the session (default) then we will never
start with an empty session. Even if the user closes all tabs we will re-create
a new tab pointing to about:home. So we will always at least restore this tab on
the next startup. As a consequence we will never open the 'homepage' on app start
because we will never have a non-empty session.

With this patch we won't restore tabs that point to about:home and do not contain
any other history. As a result we might restore an empty session and load the
homepage or about:home (depending on configuration) in a new tab.

In case we decide to not restore the currently selected tab, we just select the
first restored tab if there's any.

MozReview-Commit-ID: DuN03M60Gi8
2016-07-06 16:04:01 +02:00
Grigory Kruglov abb54fdb35 Bug 1278980 - Add OPENED_FROM_TABS_TRAY event, and use it to trigger "offline version" snackbar r=sebastian
For now, this event is only going to be used to cover a narrow edge case around
display of the "Showing offline version" snackbar, so let's not overthink it.

MozReview-Commit-ID: Cd9q7kwnjjQ
2016-06-24 18:06:55 -07:00
Grigory Kruglov 17104337f2 Bug 1277467 - Add OfflineTabStatusDelegate for displaying tab-is-offline notifiations when appropriate r=sebastian
- Use Content:PageShow event to inform Tabs that they were actively loaded from cache
- Move offline notification logic away from browser.js and into a delegate, which displays notifications when
tab in question is user-visible

MozReview-Commit-ID: 2qCACHyWOlp
2016-06-24 16:56:04 -07:00
Margaret Leibovic 04a1daa305 Bug 1272348 - Remove insecure login doorhanger. r=sebastian
MozReview-Commit-ID: 2wQbyL13BrC
2016-06-20 11:57:32 -04:00
Michael Comella 32967ac99d Bug 1277214 - Move remaining SafeIntentUtils functions to IntentUtils. r=grisha
I feel this better follows the util class pattern: IntentUtils acts on Intents
as StringUtils would act on Strings.

MozReview-Commit-ID: 7n2B9q1KlSy
2016-06-01 15:32:41 -07:00
Michael Comella d9505084d4 Bug 1277214 - Move SafeIntent to its own class. r=grisha
This gets used often enough that it's annoying to do full class name imports.

MozReview-Commit-ID: 7Yhp1NCgwQw
2016-06-01 15:27:41 -07:00
Michael Comella de0e96a2f3 Bug 1261210 - Rename omg.mozglue.ContextUtils -> omg.mozglue.SafeIntentUtils. r=mcomella
MozReview-Commit-ID: 99kZNBPmqes
2016-05-18 15:48:07 -07:00
Michael Comella 3b73d2373c Bug 1245493 - Don't animate when showing toolbar when FF is first unhidden. r=margaret
After this patch, I still occasionally see the toolbar positioned part
way down from the top of the screen. However, this state looks slightly
less janky without the animation I removed and I can't consistently
reproduce it anymore.  Given the DynamicToolbar.setVisible calls I make,
I'd guess this is likely to be a bug caused by BrowserApp.onTabChanged
(and thus DynamicToolbar.setVisible) not getting called instantly and
so the DynamicToolbar is initialized to a different location on screen.
I'd guess it's a bug in DynamicToolbar as to why it's positioned partially
off-screen.

There is a little bit of code duplication, but that is because the code
to load a url on a new intent is duplicated (i.e. once from GeckoApp.initialize
- the initial load - and once from GeckoApp.onNewIntent). This could
potentially be cleaned up if we moved the app loading code into onResume,
but that may not be possible since we need to wait for Gecko to start
up.

Additionally, this patch adds a lot of hard-to-follow global state, which is
also not good.

Preferred solution (bug 1269041): show the toolbar each time onStart is
called (i.e.  FF is unhidden).  This is good for the user - they'll be
more aware which page they're on - but it's janky with the current
implementation, where the page content does not scroll when the toolbar
is shown so previously visible content is hidden. Thus, I went with the
other approach.  fwiw, Chrome does this behavior, but scrolls the toolbar
offscreen shortly after it is shown.

This solution is blocked on bug 1245523.

MozReview-Commit-ID: 7JjCrIf4KTm
2016-03-28 18:50:52 -07:00
Michael Comella 3525432a9c Bug 1245493 - Add comments to existing code to clarify them. r=margaret
MozReview-Commit-ID: KwOy1KMoPaY
2016-03-28 18:41:34 -07:00
Andrzej Hunt e83ccc68d8 Bug 1263571 - Pre: onTabChanged data is always a String, declare it as such r=liuche
We're always using this as a String, we might as well make this explicit to avoid having to cast
anywhere. (We very rarely use the parameter, but some new code in the main part of Bug 1263571
would have to cast this to a String. We can avoid that if we just use the correct type.)

MozReview-Commit-ID: H8JdMzQtmRI
2016-04-23 10:32:54 +02:00
Michael Comella cad83a23ef Bug 1258789 - Add literal catch & a few others that don't break for WhitespaceAround. r=grisha
MozReview-Commit-ID: 1En0xuxT4md
2016-04-12 18:16:16 -07:00
Andrzej Hunt 49df3839fd Bug 1234319 - Post: Don't track or care about the reading list in Tabs r=mcomella
MozReview-Commit-ID: Ex89J6QLmrI
2016-03-08 09:31:15 -08:00
Jim Chen f08147f4d4 Bug 1257319 - Convert existing broadcast events to calls; r=margaret
Convert existing places where we use broadcast events to use
new GeckoAppShell calls.
2016-03-23 14:42:38 -04:00
Carsten "Tomcat" Book 1e05e48e46 Backed out changeset 3e80b5052d0b (bug 1257319) 2016-03-23 10:55:10 +01:00
Jim Chen 8ca658a8c1 Bug 1257319 - Convert existing broadcast events to calls; r=margaret
Convert existing places where we use broadcast events to use
new GeckoAppShell calls.
2016-03-22 22:24:31 -04:00
Andrzej Hunt d443193d53 Bug 1257555 - Move readermode tools into their own package r=rnewman
MozReview-Commit-ID: LaSO3VRUOuA
2016-02-29 18:03:15 -08:00
Mark Hammond 1fe94a8ecc Bug 1250391 - re-queue the tab for syncing after its favicon changes. r=nalexander 2016-03-09 09:11:37 +11:00
Margaret Leibovic 9500b29749 Bug 1004734 - Create system notification on browser update. r=liuche,mfinkle
MozReview-Commit-ID: DsVhO2kagZB
2016-02-24 12:16:46 -08:00
Margaret Leibovic 94d963d9ad Bug 1232467 - Remove "Open links in Private browsing" setting from Nightly. r=mcomella 2015-12-17 11:45:12 -05:00
Nick Alexander c682759005 Bug 1107811 - Part 1: Move Java code. r=mfinkle
#!/bin/bash
set -x
pushd mobile/android/base
# Can't be present in glob below.
rm -rf java/org/mozilla/gecko
for i in */ ; do
# But is necessary to copy into.
mkdir -p java/org/mozilla/gecko
hg mv $i java/org/mozilla/gecko ;
done
hg mv *.java java/org/mozilla/gecko
# Move back stuff we didn't want to move.
hg mv java/org/mozilla/gecko/crashreporter crashreporter
hg mv java/org/mozilla/gecko/docs docs
hg mv java/org/mozilla/gecko/locales locales
hg mv java/org/mozilla/gecko/resources resources
popd
2015-12-04 11:51:34 -08:00