| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
| 6 | 6 |
| 7 import android.content.Intent; | 7 import android.content.Intent; |
| 8 | 8 |
| 9 import org.chromium.base.ContextUtils; | 9 import org.chromium.base.ContextUtils; |
| 10 import org.chromium.base.library_loader.LibraryProcessType; | 10 import org.chromium.base.library_loader.LibraryProcessType; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 getActivityTab().loadUrl( | 44 getActivityTab().loadUrl( |
| 45 new LoadUrlParams(overrideUrl, PageTransition.AUTO_TOPLEVEL)
); | 45 new LoadUrlParams(overrideUrl, PageTransition.AUTO_TOPLEVEL)
); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 @Override | 49 @Override |
| 50 protected void onStorageIsNull(final int backgroundColor) { | 50 protected void onStorageIsNull(final int backgroundColor) { |
| 51 // Register the WebAPK. It is possible that a WebAPK's meta data was del
eted when user | 51 // Register the WebAPK. It is possible that a WebAPK's meta data was del
eted when user |
| 52 // cleared Chrome's data. When it is launched again, we know that the We
bAPK is still | 52 // cleared Chrome's data. When it is launched again, we know that the We
bAPK is still |
| 53 // installed, so re-register it. | 53 // installed, so re-register it. |
| 54 WebappRegistry.registerWebapp(WebApkActivity.this, mWebappInfo.id(), | 54 WebappRegistry.registerWebapp( |
| 55 new WebappRegistry.FetchWebappDataStorageCallback() { | 55 mWebappInfo.id(), new WebappRegistry.FetchWebappDataStorageCallb
ack() { |
| 56 @Override | 56 @Override |
| 57 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { | 57 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { |
| 58 updateStorage(storage); | 58 updateStorage(storage); |
| 59 // Initialize the update related timestamps to the regis
tration time. | 59 // Initialize the update related timestamps to the regis
tration time. |
| 60 storage.updateTimeOfLastCheckForUpdatedWebManifest(); | 60 storage.updateTimeOfLastCheckForUpdatedWebManifest(); |
| 61 storage.updateTimeOfLastWebApkUpdateRequestCompletion(); | 61 storage.updateTimeOfLastWebApkUpdateRequestCompletion(); |
| 62 // The downloading of the splash screen image happens be
fore a WebAPK's | 62 // The downloading of the splash screen image happens be
fore a WebAPK's |
| 63 // package name is available. If we want to use the imag
e in the first | 63 // package name is available. If we want to use the imag
e in the first |
| 64 // launch, we need to cache the image, register the WebA
PK and store the | 64 // launch, we need to cache the image, register the WebA
PK and store the |
| 65 // image in the SharedPreference when the WebAPK is inst
alled | 65 // image in the SharedPreference when the WebAPK is inst
alled |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 @Override | 166 @Override |
| 167 protected void onDestroyInternal() { | 167 protected void onDestroyInternal() { |
| 168 if (mUpdateManager != null) { | 168 if (mUpdateManager != null) { |
| 169 mUpdateManager.destroy(); | 169 mUpdateManager.destroy(); |
| 170 } | 170 } |
| 171 super.onDestroyInternal(); | 171 super.onDestroyInternal(); |
| 172 } | 172 } |
| 173 } | 173 } |
| OLD | NEW |