| 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 b63505107fe6f63bfd09cec8fcb4f18ddc09fc8c..055dc3d72930d2195dc96ece19f4ba8300937bf7 100644
|
| --- a/chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| +++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "components/offline_pages/offline_page_types.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/browser/web_contents_user_data.h"
|
| #include "url/gurl.h"
|
| @@ -16,6 +17,7 @@ class WebContents;
|
| }
|
|
|
| namespace offline_pages {
|
| +struct OfflinePageItem;
|
|
|
| // Per-tab class to manage switch between online version and offline version.
|
| class OfflinePageTabHelper :
|
| @@ -25,6 +27,12 @@ class OfflinePageTabHelper :
|
| ~OfflinePageTabHelper() override;
|
|
|
| private:
|
| + enum class RedirectReason {
|
| + DISCONNECTED_NETWORK,
|
| + FLAKY_NETWORK,
|
| + FLAKY_NETWORK_FORWARD_BACK
|
| + };
|
| +
|
| friend class content::WebContentsUserData<OfflinePageTabHelper>;
|
| friend class OfflinePageTabHelperTest;
|
| FRIEND_TEST_ALL_PREFIXES(OfflinePageTabHelperTest,
|
| @@ -38,13 +46,15 @@ class OfflinePageTabHelper :
|
| void DidFinishNavigation(
|
| content::NavigationHandle* navigation_handle) override;
|
|
|
| - void GotRedirectURLForSupportedErrorCode(ui::PageTransition transition,
|
| - const GURL& from_url,
|
| - const GURL& redirect_url);
|
| - void GotRedirectURLForStartedNavigation(const GURL& from_url,
|
| - const GURL& redirect_url);
|
| + void RedirectToOnline(const GURL& from_url,
|
| + const OfflinePageItem* offline_page);
|
| + void TryRedirectToOffline(RedirectReason redirect_reason,
|
| + const GURL& from_url,
|
| + const OfflinePageItem* offline_page);
|
|
|
| - void Redirect(const GURL& from_url, const GURL& to_url);
|
| + void Redirect(const GURL& from_url,
|
| + const GURL& to_url,
|
| + const OfflinePageItem* offline_page);
|
|
|
| base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_;
|
|
|
|
|