Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java |
| index b369549608351605ca3200f4d26a2d3d29b87473..7c4a070defd51917c2f13376bbf5e96ed1f2895e 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java |
| @@ -27,6 +27,9 @@ import org.chromium.webapk.lib.client.WebApkServiceConnectionManager; |
| * UI-less Chrome. |
| */ |
| public class WebApkActivity extends WebappActivity { |
| + /** Detects whether the associated Web Manifest changes. */ |
| + private ManifestUpgradeDetector mManifestUpgradeDetector = null; |
| + |
| @Override |
| protected void onNewIntent(Intent intent) { |
| super.onNewIntent(intent); |
| @@ -143,6 +146,18 @@ public class WebApkActivity extends WebappActivity { |
| } |
| @Override |
| + public void finishNativeInitialization() { |
| + super.finishNativeInitialization(); |
| + |
| + // TODO(hanxi): Ask WebApk's update manager whether to check resource updates. |
| + if (mManifestUpgradeDetector == null) { |
| + mManifestUpgradeDetector = |
| + new ManifestUpgradeDetector(getActivityTab(), mWebappInfo); |
| + } |
| + mManifestUpgradeDetector.start(); |
| + } |
| + |
| + @Override |
| public void onPause() { |
| super.onPause(); |
| initializeChildProcessCreationParams(false); |
| @@ -164,4 +179,12 @@ public class WebApkActivity extends WebappActivity { |
| } |
| ChildProcessCreationParams.set(params); |
| } |
| + |
| + @Override |
| + protected void onDestroyInternal() { |
| + if (mManifestUpgradeDetector != null) { |
| + mManifestUpgradeDetector.destroy(); |
|
Yaron
2016/07/25 15:55:02
null it out.
Xi Han
2016/07/25 20:01:37
Since we need to call super.onDestroyInternal() at
|
| + } |
| + super.onDestroyInternal(); |
| + } |
| } |