| Index: chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.h b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| index 6bf460b072ceeafb3ef5662e8ecdf2edb6552e56..56ece35f7cca566815b59a5c37bf603804f80970 100644
|
| --- a/chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| +++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| @@ -61,21 +61,24 @@ class OfflinePageTabHelper :
|
| // Prohibitively slow means that the NetworkQualityEstimator reported a
|
| // connection slow enough to warrant showing an offline page if available.
|
| REDIRECTED_ON_PROHIBITIVELY_SLOW_NETWORK = 10,
|
| PAGE_NOT_FOUND_ON_PROHIBITIVELY_SLOW_NETWORK = 11,
|
| PAGE_NOT_FRESH_ON_PROHIBITIVELY_SLOW_NETWORK = 12,
|
| REDIRECT_RESULT_MAX,
|
| };
|
|
|
| ~OfflinePageTabHelper() override;
|
|
|
| - const OfflinePageItem* offline_page() { return offline_page_.get(); }
|
| + const OfflinePageItem* offline_page() const { return offline_page_.get(); }
|
| +
|
| + // Whether the page is an offline preview.
|
| + bool is_offline_preview() const { return is_offline_preview_; }
|
|
|
| private:
|
| friend class content::WebContentsUserData<OfflinePageTabHelper>;
|
| friend class OfflinePageTabHelperTest;
|
| FRIEND_TEST_ALL_PREFIXES(OfflinePageTabHelperTest,
|
| NewNavigationCancelsPendingRedirects);
|
|
|
| explicit OfflinePageTabHelper(content::WebContents* web_contents);
|
|
|
| void SetDelegateForTesting(std::unique_ptr<Delegate> delegate);
|
| @@ -110,18 +113,22 @@ class OfflinePageTabHelper :
|
| bool IsInRedirectLoop(const GURL& to_url) const;
|
|
|
| void ReportRedirectResultUMA(RedirectResult result);
|
|
|
| // Iff the tab we are associated with is redirected to an offline page,
|
| // |offline_page_| will be non-null. This can be used to synchronously ask
|
| // about the offline state of the current web contents.
|
| std::unique_ptr<OfflinePageItem> offline_page_;
|
| std::unique_ptr<Delegate> delegate_;
|
|
|
| + // Whether the page is an offline preview. Offline page previews are shown
|
| + // when a user's effective connection type is prohibitively slow.
|
| + bool is_offline_preview_;
|
| +
|
| base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper);
|
| };
|
|
|
| } // namespace offline_pages
|
|
|
| #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_
|
|
|