Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Issue 1845233002: Store standalone web app data in WebappDataStorage as well as the homescreen intent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-deep-linking
Patch Set: Final nit Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
index b5516dcab8f0f3ac40c15552f55856815a81a275..dc5a805a3e0244c2be00270695f875962b074d40 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -252,20 +252,28 @@ public class WebappActivity extends FullScreenActivity {
? WebappUma.SPLASHSCREEN_COLOR_STATUS_CUSTOM
: WebappUma.SPLASHSCREEN_COLOR_STATUS_DEFAULT);
- // The scope may have been purged by the user clearing their history. It is
- // needed to be able to launch a webapp from a notification. Make sure that the
- // scope exists by restoring it on webapp launch; this method will no-op if the
- // scope does exist as it should not be possible to overwrite any set scope.
- WebappDataStorage.setScope(this, mWebappInfo.id(), mWebappInfo.uri().toString());
-
- // Retrieve the splash image if it exists.
- WebappDataStorage.open(this, mWebappInfo.id()).getSplashScreenImage(
- new WebappDataStorage.FetchCallback<Bitmap>() {
+ final Intent intent = getIntent();
+ WebappRegistry.getWebappDataStorage(this, mWebappInfo.id(),
+ new WebappRegistry.FetchWebappDataStorageCallback() {
@Override
- public void onDataRetrieved(Bitmap splashImage) {
- initializeSplashScreenWidgets(backgroundColor, splashImage);
+ public void onWebappDataStorageRetrieved(WebappDataStorage storage) {
+ if (storage == null) return;
+
+ // The information in the WebappDataStorage may have been purged by the
+ // user clearing their history or not launching the web app recently.
+ // Restore the data if necessary from the intent.
+ storage.updateFromShortcutIntent(intent);
+
+ // Retrieve the splash image if it exists.
+ storage.getSplashScreenImage(new WebappDataStorage.FetchCallback<Bitmap>() {
+ @Override
+ public void onDataRetrieved(Bitmap splashImage) {
+ initializeSplashScreenWidgets(backgroundColor, splashImage);
+ }
+ });
}
- });
+ }
+ );
}
private void initializeSplashScreenWidgets(int backgroundColor, Bitmap splashImage) {

Powered by Google App Engine
This is Rietveld 408576698