When clearing private data on exit, Gecko sends a "Sanitize:ClearHistory" message back to the Java UI, so the latter can clear the history DB if necessary.
For some users, this process is not working, presumably because there is a race condition depending on whether Gecko gets as far as sending that message before the background thread responsible for receiving that message has already shut down/had its listener unregistered, or not.
Therefore, we now wait until the UI's sanitize handlers have been called before starting to shut it down as well.
MozReview-Commit-ID: HoifMYv3spA
--HG--
extra : rebase_source : de4bb656c67104b9d5b1ea83329b77de0688a5d6
The notification bar will be dimmed if in Reader Mode and user scroll
down the page. If not in Reader Mode, make sure the notification bar is
not dimmed.
MozReview-Commit-ID: 87LisdS3nRO
--HG--
extra : rebase_source : c7a6795a2b9b007aeddbee1044f94168a03cd761
Convert the "TextSelection:*" events to use BundleEventListener /
GeckoBundle, in both ActionBarTextSelection.java and
FloatingToolbarTextSelection.java. UI events are used because the
listeners require the UI thread. The "TextSelection:Update" listeners
are removed because the event is no longer sent by ActionBarHandler.
Convert "Doorhanger:Add" and "Doorhanger:Remove" to bundle events. UI
events are used because the listener performs UI operations. As part of
the refactoring, DoorHangerConfig was refactored to use GeckoBundle, and
due to that change, a lot of other doorhanger-related classes also had
to be refactored to use GeckoBundle.
Doing QI from nsIEditor to nsIEditorIMESupport doesn't make sense because editor should always support all methods and attributes of nsIEditorIMESupport (it does NOT mean that all nsIEditor implementation need to support IME).
This patch moves all of them to nsIEditor for avoiding redundant QIs.
MozReview-Commit-ID: DzIKuGHG4iy
--HG--
extra : rebase_source : cc5e9a6ae4572ebe461d9770ffa5c23d33dc8526
Convert "SearchEngines:Data" to use BundleEventListener/GeckoBundle,
including usages in BrowserSearch, SearchPreferenceCategory,
testAddSearchEngine, testDistribution, etc. Also, convert JSON parsing
code in various classes. UI thread is used because the event listeners
perform various UI operations based on the event data.
Convert events that are only used in robocop tests to Bundle events,
which are then used through Actions.expectGlobalEvent /
expectWindowEvent.
"Content:" prefix is added to "DOMContentLoaded" to follow the event
naming convention.
SelectionHandlerTest.java is removed because it's no longer used
anywhere.
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.
Context menu items used UUIDs as their prompt list item IDs. However,
prompt list items only support integers as IDs. This error didn't show
up before because JSONObject was silently ignoring the error. This patch
changes to using an incremental integer as the ID and fixes the error.
The idea is that cancelling edit mode when opening a new tab implies that we want to select it as well, otherwise we wouldn't have to cancel edit mode in the first place.
MozReview-Commit-ID: Gova1ymzlHn
--HG--
extra : rebase_source : a1d957de82a5e1ec9bf9162e1f01641e34e16ab4
This can happen if the users sets browser.sessionstore.max_tabs_undo to 0 - with no closed tabs available, without this fix the resulting exception breaks browser.js's closed tab handling, meaning the tab gets closed in the UI but not in Gecko.
MozReview-Commit-ID: 7yMyIB6UzAB
--HG--
extra : rebase_source : 37ca55519b30cbd5d263127d3ecd6b893ccfafc9
Add a new EventDispatcher interface to Messaging.jsm, and provide means
to access either the global EventDispatcher through
EventDispatcher.instance or a per-window EventDispatcher through
EventDispatcher.for(window). The old Messaging object is retained until
we can convert all existing uses of it in Fennec to use EventDispatcher,
at which point `Messaging` will be made to point to
`EventDispatcher.instance`.
This patch removes support for mozapp iframes, leaving support for
mozbrowser iframes intact. Some of the code has been rewritten in order
to phrase things in terms of mozbrowser only, as opposed to mozbrowser
or app. In some places, code that was only useful with apps has been
completely removed, so that the APIs consumed can also be removed. In
some places where the notion of appId was bleeding out of this API, now
we use NO_APP_ID. Other notions of appId which were restricted to this
API have been removed.
This patch removes support for mozapp iframes, leaving support for
mozbrowser iframes intact. Some of the code has been rewritten in order
to phrase things in terms of mozbrowser only, as opposed to mozbrowser
or app. In some places, code that was only useful with apps has been
completely removed, so that the APIs consumed can also be removed. In
some places where the notion of appId was bleeding out of this API, now
we use NO_APP_ID. Other notions of appId which were restricted to this
API have been removed.
For the short sound, we don't want to show the media control interface for them, eg. game effect.
Therefore, we check the media's duration to decide whether need to notify Java side "Tab:MediaPlaybackChange" or not.
MozReview-Commit-ID: 8PlQl2w2BSI
--HG--
extra : rebase_source : c4e5d38eae1dba22af268ea575dd6c9672e7cf9f