Commit Graph
98 Commits
Author SHA1 Message Date
Michael Comella 9598c2efe6 Bug 1393699: Add referrerURI to Tabs.loadUrl flows. r=liuche
This will allow us to call Tabs.loadUrl with a referrer URI from the Pocket top
stories.

MozReview-Commit-ID: IGdoTo80SGG
2017-08-30 15:26:03 -07:00
Jan Henning 22e4b15e96 Bug 1389564 - Part 2 - Test that restored (background) tabs are correctly written back to disk. r=gbrown
So far, we haven't tested session restoring and saving in combination, which led to bug 1379374 where restored background tabs weren't being written back to disk after upgrading to Firefox 55.

MozReview-Commit-ID: 7CUbis7u8fb
2017-08-11 19:57:56 +02:00
Jing-wei Wu 43bdef7b14 Bug 1375351 - Part 3: Remove SkinConfig. r=nechen,walkingice
SkinConfig is used to detect current skin is Australis or Photon at runtime.
Since we don't support Australis anymore in Nightly, this class should be removed.

MozReview-Commit-ID: 8yjTFYyQcgt
2017-08-09 14:19:28 +08:00
Nevin Chen 6cf395ca95 Bug 1384480 - Move MMA event to UI code. r=sebastian
MozReview-Commit-ID: FzrLqWVFWO0
2017-07-26 17:49:58 +08:00
cnevinc bb19e0422d Bug 1383762 - Change the event timing for adding a new normal tab. r=maliu
MozReview-Commit-ID: Lyf7yeTFpzq
2017-07-26 00:30:22 +08:00
Jan Henning 5e72a2ed31 Bug 1366098 - Part 1 - Remove Fennec tab type infrastructure. r=walkingice
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
2017-06-27 14:13:40 -07:00
jwu dfce311abb Bug 1366659 - Show default homepage when creating a private tab. r=walkingice
MozReview-Commit-ID: JhGZIFgGYou
2017-07-04 10:52:08 +08:00
Nevin Chen d7e88f6f4f Bug 1377022 - Remove revisit Leanplum event. r=maliu
MozReview-Commit-ID: DlnGoOzHwz9
2017-06-29 14:24:15 -07:00
Nevin Chen 272ed1a7e9 Bug 1375931 - Align event name format r=nechen
MozReview-Commit-ID: 2Af1z7dYnsC
2017-06-28 18:23:47 -07:00
Dylan Roeh 3c40b42348 Bug 1365599 - Make Tabs use the window event dispatcher rather than global in some instances. r=jchen 2017-06-16 13:40:48 -05:00
Eugen Sawin 082e2224bd Bug 1369689 - [1.0] Make page load time logs depend on web progress events instead of throbber activity. r=snorp 2017-06-06 12:56:15 +02:00
Dylan Roeh 11f96ed230 Bug 1369393 - Backout GV-based custom tabs, PWAs, and Tabs.java changes. r=me 2017-06-01 09:28:31 -05:00
Dylan Roeh 2c114d0964 Bug 1365599 - Make Tabs use the window event dispatcher rather than global in some instances. r=jchen 2017-05-31 16:58:54 -05:00
Nevin Chen a110ffbac7 Bug 1361664 - Part2. Create MVP Triggers and Deeplinks for Mobile Marketing Automatin. r=maliu
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
2017-05-17 01:25:45 +08:00
Sebastian Hengst 3b4b03d8fb Backed out changeset d289ee2c794d (bug 1361664)
MozReview-Commit-ID: gNRtEiyg7W
2017-05-27 14:00:27 +02:00
Nevin Chen 912e74135b Bug 1361664 - Part2. Create MVP Triggers and Deeplinks for Mobile Marketing Automatin. r=maliu
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
2017-05-17 01:25:45 +08:00
Sebastian Hengst 4f36d5e85b Backed out changeset 59dc8710d768 (bug 1361664) 2017-05-26 13:40:51 +02:00
Nevin Chen 592593a928 Bug 1361664 - Part2. Create MVP Triggers and Deeplinks for Mobile Marketing Automatin. r=maliu
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
2017-05-17 01:25:45 +08:00
Jan Henning a36b9a932d Bug 1359531 - Part 5 - Trigger activity switching from GeckoApp. r=sebastian,walkingice
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
2017-04-29 15:20:19 +02:00
Jan Henning 3c65d21240 Bug 1359531 - Part 3 - Creating new intents is a job for IntentHelper. r=sebastian,walkingice
MozReview-Commit-ID: 9s7aP35Q0AJ
2017-04-28 22:35:29 +02:00
Jan Henning c11ad4d04b Bug 1359531 - Part 2 - Move some tab switch functionality to the tab object. r=sebastian,walkingice
These methods already take a tab object as their argument, so we just turn them into Tab member functions.

MozReview-Commit-ID: 7fp7bzDbRja
2017-04-28 22:35:57 +02:00
Ryan VanderMeulen 4551e69b02 Merge m-c to autoland. a=merge 2017-05-19 12:26:48 -04:00
Jan Henning a76b19e64c Bug 1363049 - getNextTab() should only use parent tabs of the same type. r=walkingice
That is if the currently selected tab has a web app or custom tab as its "parent tab", we'll ignore that fact when the tab is closed from the tabs tray, so we don't trigger an activity switch that way.

MozReview-Commit-ID: 7bOi90RQUhA
2017-05-18 20:45:22 +02:00
Alastor Wu 524ac35a9c Bug 1357639 - part8 : add annotiation @RobocopTarget. r=sebastian
To make sure these functions can be used in robocop test.

MozReview-Commit-ID: KPAKOrg5Ows
2017-05-08 14:10:56 +08:00
Sebastian Hengst 665f48c295 Backed out changeset 7ded779bd7fc (bug 1357639) 2017-05-04 21:23:42 +02:00
Alastor Wu be4b610ff8 Bug 1357639 - part8 : add annotiation @RobocopTarget. r=sebastian
To make sure these functions can be used in robocop test.

MozReview-Commit-ID: KPAKOrg5Ows
2017-05-04 15:24:00 +08:00
Sebastian Hengst fc80525db1 Backed out changeset d37e0ce6c7c9 (bug 1357639) 2017-05-02 21:40:30 +02:00
Alastor Wu baf897cdd3 Bug 1357639 - part8 : add annotiation @RobocopTarget. r=sebastian
To make sure these functions can be used in robocop test.

MozReview-Commit-ID: KPAKOrg5Ows
2017-05-02 18:53:40 +08:00
Jim Chen f91a210834 Bug 1365122 - Move launchOrBringToFront from GeckoAppShell to GeckoApp; r=droeh
Move GeckoAppShell.launchOrBringToFront to GeckoApp, so that we can use
GeckoActivityMonitor to check whether BrowserApp is the current
foreground Activity. This lets us remove GeckoInterface.isForegrounded.

MozReview-Commit-ID: CgjnaNK8OGW
2017-05-18 18:09:04 -04:00
Jan Henning 9a42cb6409 Bug 1352997 - Part 7 - Don't switch activities if we're closing a tab while exiting the activity. r=sebastian,walkingice
Closing the currently selected tab will select another tab, which can trigger an activity switch if the tab types differ. We don't want that if we're about to close the activity, as that'll bring that activity into the foreground instead of simply walking back along the activity history stack.

To give an example: Without this patch, closing the last custom tab will select a normal browsing tab, which will trigger an activity switch, so instead of returning to the user's previous activity, pressing back will send us to BrowserApp.

There's one additional catch:
If we change our onDone() behaviour and no longer finish() the SingleTabActivity when exiting (in order to avoid a costly restart of Gecko should the user return to us soon), this means that the activity that has just been exited could be brought back into the foreground via the onResume() codepath.

In that case the mLastActiveGeckoApp-check won't be triggered if no other GeckoApp-based activity was active in the meantime, so we wouldn't reselect/reopen the activity's desired tab, but instead display the tab that was selected when closing the previous tab. Therefore, we track this via an additional flag that is set for this case.

MozReview-Commit-ID: 3jOvBXQUrfo
2017-04-14 19:58:09 +02:00
Jan Henning ab33946bd2 Bug 1352997 - Part 5 - Implement common behaviour for custom tabs/web apps and switch over the former. r=sebastian,walkingice
This implements the common behaviour for restoring the correct tab when switching to/from custom tab and web app activities. Unlike our normal UI, those activities are basically single tab activities, that is each activity is linked to a certain Gecko tab, with no facilities (bugs aside) for the user to directly load/select a different tab within that activity.

Therefore, here we basically update the selected tab only when the activity is starting up and initially creating its new (or, especially once tab type switching will be implemented, taking over an existing) content tab.

When subsequently restoring, we then check whether the tab is still available. If it is, we select it, if not, we fall back to opening a new tab based on the available intent data.

This also means that we no longer have to finish() the activity on closing so the activity state (finished) matches the tab (closed), which means that we no longer have to prematurely kill Gecko as a side effect of that.

MozReview-Commit-ID: KjFz1qrqWLy
2017-04-08 19:19:32 +02:00
Jan Henning bcf91f0d9c Bug 1352997 - Part 3 - Re-implement tracking of last selected tab for BrowserApp. r=sebastian,walkingice
Currently, we basically take a snapshot of the currently selected tab when pausing an activity and then later re-select that tab ID when switching back from another activity within our application. In practice, this doesn't seem entirely fool-proof, so when switching between our normal UI (BrowserApp) and custom tabs or web apps we can eventually end up with the wrong tab being selected in the wrong activity.

In this part, we'll rip out the current code and replace it by a new implementation for BrowserApp - following parts will then cover custom tabs and web apps.

As BrowserApp is our normal tabbed browsing interface, we can simply track all tab switches for BROWSING-type tabs as they happen, which ensures that our data is always up-to-date.

Because tab IDs remain unique only within the same application session and are reused if we're terminated and then later restart, we need to take additional precautions to make sure we're really selecting the correct tab object - the savedInstanceState can carry even across (OOM-)kills. Therefore we now additionally also store and compare the current per-session UUID to make sure that the tab we're trying to select is really the same one it was when the activity was last running.

For BrowserApp caring about this is less important because on a full startup, the selection behaviour will be overridden by session restore anyway (although we can still hit it if only BrowserApp gets destroyed while Gecko keeps running, or if BrowserApp is launched after some other activity has already loaded Gecko), but it'll be quite relevant for web apps and custom tabs which don't have that benefit.

As it stands, this patch temporarily breaks behaviour around activity restoring for custom tabs/web apps, but tearing the old implementation out in one go was easier and the patch needs to be split somewhere.

MozReview-Commit-ID: I0Tq9XZGvpV
2017-04-08 22:55:10 +02:00
Jan Henning e420adebbe Bug 1352997 - Part 2 - Provide dedicated methods for typical homepage operations. r=sebastian,walkingice
That is figuring out whether a homepage has been set (but not caring about the specific page), or else getting the homepage URL with an automatic fallback (to about:home) if no homepage has been set.

MozReview-Commit-ID: D6Uy3A4P4Qc
2017-04-09 19:30:21 +02:00
Jan Henning 23d92edb83 Bug 1351739 - Part 5 - Implement activity switching for web apps. r=sebastian,walkingice
Differences to custom tabs:
- We don't have to store the full intent, just storing the manifest path is enough.
- Akin to the LauncherActivity we have to route the request to the correct WebAppActivity instance depending on the manifest path.

We also have to modify the intent handling when GeckoApp is starting up - the intent handling of the GeckoApp + BrowserApp combo requires "nulling" out (by setting it to ACTION_MAIN) the current intent if it's not a fresh intent (e.g. the activity is recreated after having been destroyed or relaunched from the task switcher).

For web apps on the other hand we want to keep the intent around even in those cases, as it contains state we need even later on. Additionally, we want to make use of GeckoApp's startup code for either selecting the tab from the intent or loading a new tab. Therefore we save the launch intent and restore it once GeckoApp's onCreate() has run.

Note that this solution is not entirely correct either, because with this each onCreate() call will open a new tab, even when this is not necessary when only the activity (but not Firefox and Gecko as a whole) had been destroyed. This behaviour will be fixed as part of bug 1352997.

This approach is also a bit different than the one chosen in bug 1351605 for custom tabs, which was independently developed in parallel. Bug 1352997 will unify this, too.

MozReview-Commit-ID: 94uZ3c8CUVD
2017-04-02 18:26:45 +02:00
Jan Henning 55f91d51df Bug 1351739 - Part 3 - Switch activities when a custom tab is selected/unselected. r=sebastian,walkingice
On tab selection, the Tabs instance now checks whether the type of the tab to be selected matches the currently running activity. If it doesn't, the tab switching is aborted and instead, an intent for the correct activity is sent. When the new activity launches, it finds that the intent also includes a tab ID, which means that instead of opening a new tab we retry the tab selection, which will then succeed now that we're in the correct activity.

Because for custom tabs the launch intent can contain all sorts of customisations, we now have to save the intent when a custom tab is opened for the first time, so that later on, when switching e.g. from BrowserApp back to a custom tab we can use the correct intent to launch the custom tab activity.

MozReview-Commit-ID: KWdkweKBocz
2017-04-08 23:10:51 +02:00
Jan Henning 6c68386e49 Bug 1351739 - Part 0 - Use INVALID_TAB_ID more. r=sebastian,walkingice
-1 is probably not all that mysterious as far as magic numbers go, but still...

MozReview-Commit-ID: zK3P6HeWzK
2017-04-06 21:30:55 +02:00
brainbreaker cb0aac6bdd Bug 1347583 - Allow third-party apps to open a tab in private browsing mode; r=sebastian
MozReview-Commit-ID: 6eM3E8qm9YE
2017-04-24 19:32:55 +05:30
Randall Barker c955f482b1 Bug 1335895 - Android GeckoView Dynamic Toolbar Version 3 r=botond,dvander,jchen,kats
This version of the Dynamic Toolbar moves the animation of the toolbar
from the Android UI thread to the compositor thread. All animation for
showing and hiding the toolbar are done with the compositor and a static
snapshot of the real toolbar.

MozReview-Commit-ID: BCe8zpbkWQt
2017-04-20 15:15:14 -07:00
nechen aa8e0ccbf9 Bug 1293713 - Make new tab action respect HomePage preference. r=mkaply,sebastian
MozReview-Commit-ID: 9N7tLrr20nv
2017-03-13 16:13:18 +08:00
Tom Klein c91d7f17d7 Bug 1350718 - Post: Name the special value -1 used to indicate a new tab should be appended. r=maliu
MozReview-Commit-ID: 7r8cHItW4wG
2017-04-06 11:27:42 -05:00
Dale Harvey 59b96c4d92 Bug 1351834 - Give webapp tabs correct type when launched. r=janh 2017-04-01 15:23:18 +01:00
Jan Henning c568532951 Bug 1346004 - Part 5 - Replace Gecko customtab tab attribute by a generic type attribute. r=sebastian
This'll allow customising context menu/session store/... behaviour in Gecko depending on the tab type, since in the future we might not only have special behaviour for custom tabs, but for web app tabs etc. as well.

MozReview-Commit-ID: LS6oGfO4KpR
2017-03-12 16:13:10 +01:00
Jan Henning 5469ee9fae Bug 1346004 - Part 3 - getNextTab() should fall back to browsing-type tabs if no tabs of the same type are available. r=sebastian
We always want at least one browsing type tab open to match current behaviour and assumptions built into the app, but the same doesn't hold true for other tab types. A CustomTabActivity instance e.g. only holds a single tab, so the lifetime of the tab is tied to the lifetime of the CustomTabActivity. If we're exiting the activity, we just want to close the corresponding tab without opening a new replacement for it.

Since we have to select some other tab instead in that case (so the selected tab in the tab list and the selected tab in Gecko remain in sync and so we always have a selected tab), getNextTab() therefore has to fall back to browsing-type tabs as a default if no other tabs of the same type are available.

MozReview-Commit-ID: IpvINlu5Qq9
2017-03-11 20:57:54 +01:00
Jan Henning 12ae52a4e4 Bug 1346004 - Part 2 - Tabs helper functions for searching next/previous tab should take the Tab type into account. r=sebastian
MozReview-Commit-ID: DRBjBrndDWW
2017-03-11 20:29:17 +01:00
Jan Henning bec7a01acb Bug 1346004 - Part 1 - Keep track of a tab type on the Java tab object. r=sebastian
As long as the tabs are opened in the same Gecko browser window, splitting the Java UI tabs list into multiple parts breaks too many assumptions, so the easier solution is to allow setting a type attribute on each tab object, which will allow filtering of them later on.

MozReview-Commit-ID: 1PbxMkWTK47
2017-03-11 20:04:07 +01:00
Jan Henning f07b123d03 Bug 1346004 - Part 0 - Remove unneeded imports. r=sebastian
MozReview-Commit-ID: GsXHhrvNRSy
2017-03-12 16:18:48 +01:00
Tom Klein f4e311c28f Bug 1331154 - 7. Update the tab strip after tabs are moved in the tabs tray. r=sebastian
The tabs tray is drawn on top of the tab strip, not instead of it, so the tab
strip needs to be updated after tabs are moved in the tabs tray before the tab
strip becomes user-visible again.

This introduces a slight change in behavior: *if* a move (of a tab matching the
privacy state of the tab strip) occurs while the tabs panel is open, the tab
strip will be scrolled to the currently selected tab when the tabs panel is
closed - previously the tab strip maintained its old scroll position if a tab
wasn't closed or added while the tabs panel was open.

MozReview-Commit-ID: Ipy5huthNYB
2017-02-25 19:22:01 -06:00
Tom Klein c848c451a6 Bug 1331154 - 5. Notify browser.js when a tab gets moved. r=sebastian
Session store will be notified in the next patch.

MozReview-Commit-ID: APTJykdnMF2
2017-02-02 21:02:51 -06:00
Tom Klein 145bf22c98 Bug 1331154 - 3. Add a cache to remember the position of the last tab move. r=sebastian
MozReview-Commit-ID: 5gEpwYuphKm
2017-02-02 15:55:25 -06:00
Tom Klein 04db4f07f8 Bug 1331154 - 2. Update the tabs list in Tabs when a tab is moved. r=sebastian
A cache to remember the position of the tab that was just moved will be added in
the next commit.

MozReview-Commit-ID: 5V4FSpcJ69Z
2017-02-05 10:47:47 -06:00