Chromium Code Reviews| 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..4ca83ffa36b6249eba95a00acc05ab7cc07fa54c 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(), |
|
gone
2016/04/01 23:44:48
Does this extra callback significantly affect how
dominickn
2016/04/04 07:26:23
The extra callback should only affect how long it
|
| + new WebappRegistry.FetchWebappDataStorageCallback() { |
| @Override |
| - public void onDataRetrieved(Bitmap splashImage) { |
| - initializeSplashScreenWidgets(backgroundColor, splashImage); |
| + public void onWebappDataStorageRetrieved(WebappDataStorage storage) { |
| + if (storage == null || intent == null) return; |
| + |
| + // The information in the WebappDataStorage may have been purged by the |
| + // user clearing their history or not launching the web app recently. |
| + // Asynchronously 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) { |