Pass in a `GeckoView` instance when sending a11y events so we're not
dependent on `GeckoAppShell.getLayerView()`. However, there's likely
more work to be done to make a11y work for any GeckoView.
MozReview-Commit-ID: DBeDOX5c3qY
Pass in a `GeckoView` instance when sending a11y events so we're not
dependent on `GeckoAppShell.getLayerView()`. However, there's likely
more work to be done to make a11y work for any GeckoView.
MozReview-Commit-ID: DBeDOX5c3qY
Move the "Share:Text" event listener from GeckoApp to GeckoApplication,
so ActionBarHandler.js can use it for the Share action from any window.
MozReview-Commit-ID: 8w1llJy4pwy
Make TextSelection implementations not depend on GeckoApp. Instead, make
them use GeckoView's EventDispatcher directly for communicating with
Gecko.
MozReview-Commit-ID: EygAt3D9HMI
Use event callbacks instead of separate events to deliver
FormAssistPopup replies back to FormAssistant. This lets us better
handle having multiple FormAssistPopup instances across Fennec, custom
tabs, and PWAs.
FormAssistant._currentInputElement is removed because it does not allow
us to have multiple concurrent popups. Instead, we track the current
element through the event callback closure.
FormAssistant._currentInputValue is also removed for similar reasons,
and I don't think it was really necessary.
MozReview-Commit-ID: DdeMBGCxDou
Our user-facing builds crash if we manage to slip in some main thread network access by mistake (which is the default Android StrictMode policy since Honeycomb), so our developer builds shouldn't be more forgiving here.
MozReview-Commit-ID: 6bZwwwrSb3q
Currently, this only concerns setImageAs, where not running on the UI thread after a permissions prompt triggers a network-related strict mode violation and interestingly enough results in a crash (as opposed to a logcat complaint) on release builds.
There's also a permissions check in the UpdateService which runs on a (but not *the*) background thread, but since we don't prompt in that case there's no action necessary.
MozReview-Commit-ID: KKxW96AyDWH
Right now we have two Snackbar handlers in GeckoApp and
GeckoPreferences, respectively. This patch combines the two handlers
into one inside GeckoApplication, and lets us display Snackbars in other
Activities like custom tabs and PWA.
MozReview-Commit-ID: Iu6p2VNnVVC
Instead of initializing IntentHelper in GeckoApp, initialize it in
GeckoApplication, and make it available globally. This will let custom
tabs / PWA use IntentHelper-provided services.
MozReview-Commit-ID: Icedph6KG4u
Move the check permission event from `GeckoApp` to `GeckoApplication`,
and use the current activity if possible, so that we can use
`RuntimePermissions` in custom tabs and PWA. Also implement
`onRequestPermissionsResult` for custom tabs and PWA, in order to
forward the result back to `RuntimePermissions`.
MozReview-Commit-ID: Bg4BoXAUCz6
We temporarily insert the image in question into the MediaStore in order to display the corresponding chooser, which requires the WRITE_EXTERNAL_STORAGE permission.
MozReview-Commit-ID: FAf9tE5h3c8
The new, preferred solution for displaying additional web content outside of our normal tab infrastructure and UI is to use a separate GeckoView instance. Therefore, the support for different having additional "tab" types that aren't displayed in the normal UI, as well as for multiple GeckoApp instances displaying different tabs is no longer needed and can be removed.
MozReview-Commit-ID: FNx0gJIKybr
Make PromptService and Prompt.jsm not depend as much on BrowserApp and
the main Fennec window, so it can be used from a GeckoView-based custom
tabs Activity. This approach is used because it involves a lot less work
than trying to implement a PromptDelegate for Fennec.
MozReview-Commit-ID: AEH0HgAOx2S
At the moment, we forward these from GeckoActivity, which means that they won't work if no GeckoActivity-based activity is active (can happen within our settings for example).
As of API14, we can now register an app-wide ComponentCallbacks(2) class, allowing us to easily receive low memory notifications no matter which activity is currently alive.
MozReview-Commit-ID: 5GjSjsTKxAD
This patch do 6 things. They are related so I put them in the same patch.
1. Extract MmaEvent Name
2. If MMA is diabled, don't send event.
3. Add check before sending 'Set Default Borwser' deep link
4. Add user attribute for delay messaging focus install status.
5. If the user pref off at runtime, we ask Leanplum to stop and prevent our app sending event to Leanplum.
6. Fix proguard. Only keep necceary files.
MozReview-Commit-ID: APEmr1JXBLH
This patch do 5 things. They are related so I put them is the same patch.
1. Extract MmaEvent Name
2. If MMA is diabled, don't send event.
3. Add check before sending 'Set Default Borwser' deep link
4. Add user attribute for delay messaging focus install status.
5. If the user pref off at runtime, we ask Leanplum to stop and prevent our app sending event to Leanplum.
MozReview-Commit-ID: APEmr1JXBLH
This patch do 5 things. They are related so I put them is the same patch.
1. Extract MmaEvent Name
2. If MMA is diabled, don't send event.
3. Add check before sending 'Set Default Borwser' deep link
4. Add user attribute for delay messaging focus install status.
5. If the user pref off at runtime, we ask Leanplum to stop and prevent our app sending event to Leanplum.
MozReview-Commit-ID: APEmr1JXBLH
Now that GeckoInterface only contains openUriExternal and
getHandlersFor* methods, we can set GeckoInterface from GeckoApplication
only, and not GeckoApp or GeckoView. This also lets us get rid of
BaseGeckoInterface.
MozReview-Commit-ID: KQloIO6ITlK
Remove GeckoAppShell.AppStateListener and its associated methods in
GeckoInterface (orientation listener and app state listener methods).
MozReview-Commit-ID: 4BCrTysSEHZ
We no longer use the activity monitor for tab type activity switching (which could happen in response to onNewIntent, so in the original implementation the GAM's current activity had to be up-to-date at that point as well) and only track the current activity via onStop/onStart, so there's no longer any need to manually monitor onNewIntent.
MozReview-Commit-ID: AawXbII29qE
This involves accessing the file system to check whether our last session crashed or not (as well as reading some shared preferences), so moving this onto the background thread as well avoids some strict mode warnings.
With the exception of loadStartupTab(), mShouldRestore and mLastSessionCrashed are always accessed from the background thread. loadStartupTab() can potentially run on the main thread, however this is okay, because as far as I can see it is only called after the main and background thread have synchronised with each other during initialize().
mPrivateBrowsingSession in turn is now initially only accessed from the background thread for storing the data from the savedInstanceState and the passing it on to session restore. Afterwards, we pass through the synchronisation in initialize() and then all further accesses - receiving private tab data from Gecko and saving it during onSaveInstanceState - happen only on the main thread. Additionally, all data updates from Gecko will completely overwrite the previous state, so the initial value set during onCreate() will soon become irrelevant, anyway.
MozReview-Commit-ID: L5hMFCXLcIf
Activity switching is now handled by the currently active GeckoApp instance, which obviously doesn't work if all of them are currently backgrounded.
To fix this, we track for each tab whether its selection was handled by a foregrounded GeckoApp instance. If it wasn't, we catch up with any possibly necessary activity switches during the next resume.
MozReview-Commit-ID: JEjQUuDJw5Q
Normally, receiving a new intent means we want to switch tabs/open a new tab, so we need to turn off our "last selected tab in this activity" logic, however this is not true when we receive a simple Intent.ACTION_MAIN, e.g. when we're being brought into the foreground from a launcher icon (as opposed to the activity/task switcher).
MozReview-Commit-ID: ExiM3c8iaEA
To avoid the need for tracking the currently active activity, we just respond from the activity itself by using GeckoApp's tab event listener.
As replacement for the "closeTabNoActivitySwitch()" function, we set a flag on the activity instead before closing the tab.
MozReview-Commit-ID: LdmyJ5i10jZ
Add getChromeUri/setChromeUri APIs to GeckoView, to allow each
GeckoView's chrome URI to be set individually. This lets us remove
GeckoInterface.getDefaultChromeURI. This patch also changes the default
chrome URI to the GeckoView default, and let Fennec specify its chrome
URI (browser.xul) inside GeckoApp.
MozReview-Commit-ID: Gkwbp8VyLcu
Instead of calling GeckoInterface.setAccessibilityEnabled, let
GeckoAccessibility dispatch an "Accessibility:Enabled" event to let
BrowserApp know whether accessibility is enabled or not.
MozReview-Commit-ID: 9ntRP5Pc3lX
Move checkUriVisited, markUriVisited, and setUriTitle from
GeckoApp/GeckoAppShell to GlobalHistory. Make them static and directly
accessible from native code, so that we can remove those methods from
GeckoInterface.
MozReview-Commit-ID: JrmlfeKibaW