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

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

Issue 2517213002: Fix ManifestUpgradeDetectorTest#testManifestEmptyScopeShouldNotUpgrade() (Closed)
Patch Set: Merge branch 'master' into update_fail_refactor000 Created 4 years, 1 month 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/ManifestUpgradeDetectorFetcher.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
index a017c2d61c15373b1c35a09e4a5f8c970967a670..693aff47a8b198e13fe9e8f2408b933008c02541 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
@@ -55,21 +55,19 @@ public class ManifestUpgradeDetectorFetcher extends EmptyTabObserver {
private long mNativePointer;
/** The tab that is being observed. */
- private final Tab mTab;
+ private Tab mTab;
- private Callback mCallback;
-
- public ManifestUpgradeDetectorFetcher(Tab tab, String scopeUrl, String manifestUrl) {
- mTab = tab;
- mNativePointer = nativeInitialize(scopeUrl, manifestUrl);
- }
+ protected Callback mCallback;
/**
* Starts fetching the web manifest resources.
* @param callback Called once the Web Manifest has been downloaded.
*/
- public boolean start(Callback callback) {
- if (mTab == null || mTab.getWebContents() == null) return false;
+ public boolean start(Tab tab, String scopeUrl, String manifestUrl, Callback callback) {
+ if (tab.getWebContents() == null) return false;
+
+ mTab = tab;
+ mNativePointer = nativeInitialize(scopeUrl, manifestUrl);
mCallback = callback;
mTab.addObserver(this);
nativeStart(mNativePointer, mTab.getWebContents());
@@ -107,7 +105,7 @@ public class ManifestUpgradeDetectorFetcher extends EmptyTabObserver {
* Called when the updated Web Manifest has been fetched.
*/
@CalledByNative
- private void onDataAvailable(String startUrl, String scopeUrl, String name, String shortName,
+ protected void onDataAvailable(String startUrl, String scopeUrl, String name, String shortName,
String bestIconUrl, String bestIconMurmur2Hash, Bitmap bestIconBitmap,
String[] iconUrls, int displayMode, int orientation, long themeColor,
long backgroundColor) {

Powered by Google App Engine
This is Rietveld 408576698