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

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

Issue 1749603002: Store URLs in WebappDataStorage, and purge them when history is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 21db4502bd4f6395565875acc2318101a8ca007d..b5516dcab8f0f3ac40c15552f55856815a81a275 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
@@ -219,7 +219,7 @@ public class WebappActivity extends FullScreenActivity {
@Override
public void postInflationStartup() {
- initializeSplashScreen();
+ initializeWebappData();
super.postInflationStartup();
WebappControlContainer controlContainer =
@@ -234,7 +234,7 @@ public class WebappActivity extends FullScreenActivity {
return mWebappInfo;
}
- private void initializeSplashScreen() {
+ private void initializeWebappData() {
final int backgroundColor = ColorUtils.getOpaqueColor(mWebappInfo.backgroundColor(
ApiCompatibilityUtils.getColor(getResources(), R.color.webapp_default_bg)));
@@ -252,6 +252,13 @@ 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>() {
@Override

Powered by Google App Engine
This is Rietveld 408576698