Commit Graph
61 Commits
Author SHA1 Message Date
Rob Wu dbdfbfe543 Bug 1448305 - Avoid disk cache for icons of private tabs. r=JanH 2018-07-16 12:19:18 +02:00
Jan Henning 9aa44013a6 Bug 1278581 - Part 4 - Ensure the progress bar doesn't get stuck after displaying the error page. r=esawin
For a normal load, we get a request start, the various location change/load
events and then a stop. When encountering an error (e.g. server not found), the
usual event order is start, stop and then the location change/load events while
the error page is loading (compare bug 976426).

When displaying the "unknown protocol" error page from within the Content-
DispatchChooser however, we never receive any onStateChange events from the
WebProgressListener. When this happens within an existing tab, this isn't a
problem - the UI never thinks that the tab is starting a page load and thanks
to bug 976426 never displays the progress bar.

When opening a link in a new tab, though, the UI speculatively creates the tab
as STATE_LOADING and shows the progress bar. Because we never receive any state
change events if the "unknown protocol" error was triggered, especially not a
"Stop" event, the progress bar then never gets hidden because the UI assumes
that the tab is still loading.

To work around this, we make use of the error type that we were still trans-
mitting during DOMContentLoaded - if an error page was detected, we reset the
tab's load state in the UI and stop the progress bar.

We also take this opportunity to change the handling of Content:LoadError
messages. Originally, this message was intended to reset the URL bar if an
attempt to load an URL resulted in an immediate error in browser.js. For un-
known reasons, the rewrite from loading throbber to progress bar changed the
meaning of the event to set the progress value of the progress bar to 80 %, just
like DOMContentLoaded.

With this patch, a Content:LoadError message will immediately stop and hide the
progress bar as well.

MozReview-Commit-ID: 8AXICB7mEfK
2018-03-22 21:51:33 +01:00
Nevin Chen b16d015b07 Bug 1424179 - Hide PWA badge when site identity updates to mix content. r=walkingice
https://m.aliexpress.com is a good target to test. But it sometimes show mixed content, sometimes not.
I also chnage the check when adding a PWA shortcut. Only fail fast in nightly and local build.

MozReview-Commit-ID: 4sLoNERIYuW
2017-12-08 15:07:42 +08:00
Jim Chen 2a860b0cf1 Bug 1423010 - 2. Fix other code that use BitmapUtils; r=rbarker
Use o.m.g.util.BitmapUtils in code that use BitmapUtils.

MozReview-Commit-ID: KPM05Aqf1kW
2017-12-05 11:40:10 -05:00
Nevin Chen 01c35325dc Bug 1419245 - A2HS badge is shown on site with broken HTTPS. r=walkingice
MozReview-Commit-ID: BFWdqTcxOi9
2017-11-23 17:07:59 +08:00
Eugen Sawin 047de07e9f Bug 1417049 - [1.2] Don't show Add to Home Screen page action for incompatible launchers. r=nechen 2017-11-29 17:27:01 +01:00
Nevin Chen d2d5bd20f5 Bug 1409191 - Prefetch manifest before install. r=snorp
This is a "hacked" fix. The key idea is to specify the value in manifest on "add to home screen confirm prompt."
We need to reuse prefetch result for  manifest.install().

The plan is to land this patch before Chrome Dev Summit(10/30) for demostration and fix the rest of the issue in a follow up bug.

MozReview-Commit-ID: A4B0ZK7UjyK
2017-10-19 00:59:58 +08:00
Nevin Chen(:nechen) 09d8da54d6 Bug 1393672 - Show PWA onboarding and confrim prompt r=jwu
MozReview-Commit-ID: Kzih56Om7NO
2017-09-26 15:52:36 +08:00
Nevin Chen(:nechen) 5c5d83d134 Bug 1393672 - Add a badge (at the same position of Page Actio) for PWA. r=jwu
This bug is for the front end work to make users more engaged with PWA.

Requirements
1. When the user goes to a web page that has manifest.json, we show a badge(in the same position of page action).
2. If the user switch to another normal page or other Java UI, the page action should be gone.
3. When the user see the PWA website for the first time, we  will display a onboarding prompt to teach him how to add PWA to home screen. This prompt only shows once.

MozReview-Commit-ID: AcyjHPVKg2b
2017-09-26 13:48:09 +08:00
James Willcox 8692a70cf1 Bug 1381916 - Remove frontend support for plugins in Fennec r=nechen
MozReview-Commit-ID: Gkqe8Y5AMPV
2017-07-31 12:25:16 -05: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
friedger 3a57c3c2aa Bug 1217675 - Eliminate Honeycomb compatibility from Fennec code r=nalexander
Remove all references to Build.SDK_INT comparing 14 and lower

MozReview-Commit-ID: JdAjYvQ6mfX
2017-06-10 08:57:55 +02:00
Jan Henning fcc41940fb Bug 1359531 - Part 8 - Handle tabs selected while all GeckoApps were in background. r=sebastian,walkingice
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
2017-05-05 21:07: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
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 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
Jim Chen 78ccd0611f Bug 1337467 - Convert observers to bundle events; r=rbarker r=sebastian
Bug 1337467 - 1. Convert "Window:Resize" observer to event; r=rbarker

Bug 1337467 - 2. Convert "ScrollTo:FocusedInput" observer to event; r=rbarker

Bug 1337467 - 3. Convert "Update:CheckResult" observer to event; r=sebastian

Also remove notifyCheckUpdateResult from GeckoInterface.

Bug 1337467 - 4. Convert "GeckoView:ImportScript" observer to event; r=sebastian

Bug 1337467 - 5. Convert accessibility observers to events; r=sebastian

Bug 1337467 - 6. Convert media/casting observers to events; r=sebastian

Bug 1337467 - 7. Convert "Sanitize:ClearData" observer to event; r=sebastian

Bug 1337467 - 8. Convert "Notification:Event" observer to event; r=sebastian

Bug 1337467 - 9. Convert BrowserApp observers to events; r=sebastian

Bug 1337467 - 10. Convert Tab observers to events; r=sebastian

Bug 1337467 - 11. Convert "Passwords:Init" and "FormHistory:Init" observers to events; r=sebastian

Bug 1337467 - 12. Convert Reader observers to events; r=sebastian

Bug 1337467 - 13. Convert Distribution observers to events; r=sebastian

Bug 1337467 - 14. Convert "Fonts:Reload" observer to event; r=sebastian

Bug 1337467 - 15. Convert RecentTabsAdapter observers to events; r=sebastian

Bug 1337467 - 16. Convert "Session:Prefetch" observer to event; r=sebastian

Bug 1337467 - 17. Convert "Browser:Quit" and "FullScreen:Exit" observers to events; r=sebastian

Bug 1337467 - 18. Convert SessionStore observers to events; r=sebastian

The "Session:NotifyLocationChange" observer is sent by browser.js and
requires passing a browser reference, so it's left as an observer.

Bug 1337467 - 19. Remove unused "Tab:Screenshot:Cancel" notifyObserver call; r=me

Bug 1337467 - 20. Convert "Session:Navigate" observer to event; r=sebastian

Bug 1337467 - 21. Convert "Locale:*" observers to events; r=sebastian

Bug 1337467 - Add log for unhandled events; r=me

Add back the log indicating no listener for an event, which can be
useful when reading logcat. r=me for trivial change.

Bug 1337467 - Don't return error from EventDispatcher when OnEvent fails; r=me

When a listener's OnEvent method returns an error, continue to dispatch
to other listeners and don't return an error from the dispatch function.
This avoids unexpected errors when dispatching events. r=me for trivial
patch.
2017-03-07 12:34:04 -05:00
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
Jan Henning 2f53d6a739 Bug 1269210 - Part 1 - Remove unused variables from location change message and Java tab object. r=ahunt
We used to need these for the back button long press history menu, but now we no longer do.

MozReview-Commit-ID: LAZYffLODN3
2017-02-11 20:13:00 +01:00
Jim Chen 3e3643da35 Bug 1337053 - Fix optString conversions; r=sebastian
JSONObject.optString defaults to empty string ("") if the key doesn't
exist, whereas GeckoBundle.getString defaults to null if the key doesn't
exist. So the correct conversion for `json.optString("foo")` should be
`bundle.getString("foo", "")`. This patch fixes the wrong conversions
from before. In case we did default to null, this patch gets rid of the
redundant null second argument to GeckoBundle.getString.
2017-02-08 19:50:33 -05:00
Jim Chen 25b8c19ecd Bug 1333589 - 3. Convert SiteIdentityPopup observers to events; r=sebastian
Convert the "Permissions:*" and "Session:Reload" observers to events
that go through GlobalEventDispatcher.
2017-01-25 18:57:32 -05:00
cnevinc f4a6834166 Bug 1317632 - If the bookmark to add is a reader mode page, defer db action till it cache completely and save the same url in bookmarks and uriannotations table to avoid URL chagne between two http requests. r=sebastian
MozReview-Commit-ID: 8ZwteTOKe1G
2017-01-14 12:05:48 +08:00
jwu 67f72e8aaa Bug 1325586 - Prevent creating IconDescriptor with null url, r=sebastian
MozReview-Commit-ID: 4y6fKR49DGG
2017-01-16 15:56:43 +08: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 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
Sebastian Kaspari dfc6c4d917 Bug 1301031 - Tab: Initialize icon request builder in constructor. r=ahunt
MozReview-Commit-ID: G6n4BAC2P17
2016-09-07 13:47:38 +02: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
Randall Barker e10d02e6a1 Bug 1291373 - [geckoview] part 5, Remove Layer and all derived classes r=snorp 2016-08-16 14:33:43 -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
Sebastian Kaspari 6b08ccaa67 Bug 1227538 - Reset site identity after entering new URL. r=margaret
MozReview-Commit-ID: oOPYDUPVq9
2016-06-07 16:54:13 +02:00
Andrzej Hunt f57c002267 Bug 1265708 - Pre: remove unused variable r=sebastian
We already pass the URL inside the JSON object.

MozReview-Commit-ID: J4RjxLAzdI
2016-06-02 13:51:52 -07:00
Carsten "Tomcat" Book 9e09b1ce30 Backed out changeset f685593ac3cc (bug 1265708) for android bustage 2016-06-04 09:26:43 +02:00
Andrzej Hunt e7a6896b35 Bug 1265708 - Pre: remove unused variable r=sebastian
We already pass the URL inside the JSON object.

MozReview-Commit-ID: J4RjxLAzdI
2016-06-02 13:51:52 -07:00
Andrzej Hunt f78ebe1f4a Bug 932335 - Part 1: differentiate between unprivileged (http(s) URLs) and privileged URLs r=nalexander
Privileged URLs  can include chrome://, jar://, ..., etc.

MozReview-Commit-ID: 3lFR7djRGAH
2016-05-23 14:43:18 -07:00
Andrzej Hunt fb7b08c79e Bug 1060544 - Part 1: allow persisting/restoring home panel state r=liuche
All home panel state is currently discarded when you navigate to another page.
We want to be able to restore state (e.g. to return to the currently opened bookmarks folder,
instead of returning to the root of the bookmarks folder). This commit adds storage and a framework
to allow homepanels to persist data.

MozReview-Commit-ID: GWDX7UZrIZs
2016-05-09 09:12:28 -07:00
Andrzej Hunt e1ddbca9b4 Bug 1265004 - Try to save in-memory reader view article instead of downloading r=margaret
This should guarantee that any reader view page will also be successfully saved offline.

MozReview-Commit-ID: 4J8cY6hYeyU
2016-05-02 15:47:46 -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