Refactor homescreen launch data so webapps can be launched without the homescreen intent |
||
Issue descriptionHomescreen shortcuts on Android contain several properties which are required to launch the app from homescreen (e.g. theme/background color). WebappActivity assumes that these properties are in the launch intent when it runs. This structure means that launching webapps from sources other than the homescreen (e.g. a notification) won't work correctly; at best, there will be some visual inconsistencies. The root problem is that Android does not have an API for querying shortcuts on the home screen after they have been added. The data in the homescreen intent should be copied to the WebappDataStorage structure on first launch from homescreen. This will all non-homescreen sources to construct an intent for launching as a webapp by querying the storage.
,
Apr 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1ce7d2f020a7452bd0399dd50e4580981deeb4dd commit 1ce7d2f020a7452bd0399dd50e4580981deeb4dd Author: dominickn <dominickn@chromium.org> Date: Fri Apr 08 03:10:04 2016 Enable deep-linking from notifications for recently used web apps on the Android home screen. This CL permits notifications pointing to a recently used, standalone-capable web app on the Android home screen to open in the standalone web frame. The web app must be added to home screen, capable of opening in standalone mode, and have been opened from the home screen within the last ten days. If any of these conditions are not met, the notification will fall back to the existing behaviour. The search for a matching web app is conducted by comparing the URL which the notification is asking to be opened with the scope of all web apps known to Chromium. The scope for a web app is its URL, minus the final component of its path, any query parameters, and any fragments. A future CL will implement the manifest scope property, which will replace this estimated scope. The web app with the longest scope that matches the URL to be opened is chosen. Additional tests for the scoped search are added in this CL. A new shortcut source is added to indicate launches from a notification, and the WebappRegistry is updated to not change the last updated time of web app data which has not been opened from the home screen. This is necessary to ensure web apps cannot spam the user with notifications to update their last used time and hence how long Chromium will cache their app data. BUG= 541711 , 594872 R=dfalcantara Review URL: https://codereview.chromium.org/1867543002 Cr-Commit-Position: refs/heads/master@{#385967} [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/ChromeServiceTabLauncher.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/chrome/browser/android/shortcut_info.h [modify] https://crrev.com/1ce7d2f020a7452bd0399dd50e4580981deeb4dd/tools/metrics/histograms/histograms.xml
,
Apr 10 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Apr 6 2016