Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "components/offline_pages/offline_page_types.h" | 10 #include "components/offline_pages/offline_page_types.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 content::NavigationHandle* navigation_handle) override; | 48 content::NavigationHandle* navigation_handle) override; |
| 49 void DidFinishNavigation( | 49 void DidFinishNavigation( |
| 50 content::NavigationHandle* navigation_handle) override; | 50 content::NavigationHandle* navigation_handle) override; |
| 51 | 51 |
| 52 void RedirectToOnline(const GURL& from_url, | 52 void RedirectToOnline(const GURL& from_url, |
| 53 const OfflinePageItem* offline_page); | 53 const OfflinePageItem* offline_page); |
| 54 void TryRedirectToOffline(RedirectReason redirect_reason, | 54 void TryRedirectToOffline(RedirectReason redirect_reason, |
| 55 const GURL& from_url, | 55 const GURL& from_url, |
| 56 const OfflinePageItem* offline_page); | 56 const OfflinePageItem* offline_page); |
| 57 | 57 |
| 58 void GetBestPageAndTryRedirect(const GURL& online_url, | |
|
Dmitry Titov
2016/06/27 22:06:04
These two named almost the same. Consider renaming
fgorski
2016/06/27 22:40:09
Done.
| |
| 59 RedirectReason reason); | |
| 60 void SelectBestPageAndTryRedirect(RedirectReason reason, | |
| 61 const GURL& online_url, | |
| 62 const MultipleOfflinePageItemResult& pages); | |
| 63 | |
| 58 void Redirect(const GURL& from_url, const GURL& to_url); | 64 void Redirect(const GURL& from_url, const GURL& to_url); |
| 59 | 65 |
| 60 // Iff the tab we are associated with is redirected to an offline page, | 66 // Iff the tab we are associated with is redirected to an offline page, |
| 61 // |offline_page_| will be non-null. This can be used to synchronously ask | 67 // |offline_page_| will be non-null. This can be used to synchronously ask |
| 62 // about the offline state of the current web contents. | 68 // about the offline state of the current web contents. |
| 63 std::unique_ptr<OfflinePageItem> offline_page_; | 69 std::unique_ptr<OfflinePageItem> offline_page_; |
| 64 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; | 70 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; |
| 65 | 71 |
| 66 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); | 72 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); |
| 67 }; | 73 }; |
| 68 | 74 |
| 69 } // namespace offline_pages | 75 } // namespace offline_pages |
| 70 | 76 |
| 71 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ | 77 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ |
| OLD | NEW |