| Index: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
|
| index b168c932c13076965547540bdaf3e825c40061ae..aad35a7a11274cc358749e0ecffc5c6ca87c23b1 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
|
| @@ -84,6 +84,7 @@ import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType;
|
| import org.chromium.chrome.browser.tabmodel.TabModelImpl;
|
| import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
| import org.chromium.chrome.browser.tabmodel.TabReparentingParams;
|
| +import org.chromium.chrome.browser.webapps.ManifestUpgradeDetector;
|
| import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
|
| import org.chromium.components.navigation_interception.InterceptNavigationDelegate;
|
| import org.chromium.components.security_state.ConnectionSecurityLevel;
|
| @@ -183,6 +184,8 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
|
| /** Manages app banners shown for this tab. */
|
| private AppBannerManager mAppBannerManager;
|
|
|
| + private ManifestUpgradeDetector mManifestUpgradeDetector;
|
| +
|
| /** Controls overscroll pull-to-refresh behavior for this tab. */
|
| private SwipeRefreshHandler mSwipeRefreshHandler;
|
|
|
| @@ -1440,6 +1443,11 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
|
| if (mAppBannerManager != null) addObserver(mAppBannerManager);
|
| }
|
|
|
| + if (ManifestUpgradeDetector.isEnabled()) {
|
| + mManifestUpgradeDetector = mDelegateFactory.createManifestUpgradeDetector(this);
|
| + if (mManifestUpgradeDetector != null) addObserver(mManifestUpgradeDetector);
|
| + }
|
| +
|
| mTopControlsVisibilityDelegate =
|
| mDelegateFactory.createTopControlsVisibilityDelegate(this);
|
|
|
| @@ -1562,6 +1570,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
|
| mTopControlsVisibilityDelegate = mDelegateFactory.createTopControlsVisibilityDelegate(this);
|
| setInterceptNavigationDelegate(mDelegateFactory.createInterceptNavigationDelegate(this));
|
| mAppBannerManager = mDelegateFactory.createAppBannerManager(this);
|
| + mManifestUpgradeDetector = mDelegateFactory.createManifestUpgradeDetector(this);
|
|
|
| // Reload the NativePage (if any), since the old NativePage has a reference to the old
|
| // activity.
|
| @@ -2038,6 +2047,10 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
|
| mAppBannerManager = null;
|
| }
|
|
|
| + if (mManifestUpgradeDetector != null) {
|
| + mManifestUpgradeDetector.destroy();
|
| + mManifestUpgradeDetector = null;
|
| + }
|
| mPreviousFullscreenTopControlsOffsetY = Float.NaN;
|
| mPreviousFullscreenContentOffsetY = Float.NaN;
|
|
|
| @@ -3008,6 +3021,18 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
|
| return mAppBannerManager;
|
| }
|
|
|
| + /**
|
| + * @return the ManifestUpgradeDetector.
|
| + */
|
| + @VisibleForTesting
|
| + public ManifestUpgradeDetector getManifestUpgradeDetectorForTesting() {
|
| + return mManifestUpgradeDetector;
|
| + }
|
| +
|
| + @VisibleForTesting
|
| + public void setManifestUpgradeDetectorForTesting(ManifestUpgradeDetector detector) {
|
| + mManifestUpgradeDetector = detector;
|
| + }
|
| @VisibleForTesting
|
| public boolean hasPrerenderedUrl(String url) {
|
| return nativeHasPrerenderedUrl(mNativeTabAndroid, url);
|
|
|