| 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 "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 friend class content::WebContentsUserData<OfflinePageTabHelper>; | 28 friend class content::WebContentsUserData<OfflinePageTabHelper>; |
| 29 friend class OfflinePageTabHelperTest; | 29 friend class OfflinePageTabHelperTest; |
| 30 | 30 |
| 31 explicit OfflinePageTabHelper(content::WebContents* web_contents); | 31 explicit OfflinePageTabHelper(content::WebContents* web_contents); |
| 32 | 32 |
| 33 // Overridden from content::WebContentsObserver: | 33 // Overridden from content::WebContentsObserver: |
| 34 void DidStartNavigation( | 34 void DidStartNavigation( |
| 35 content::NavigationHandle* navigation_handle) override; | 35 content::NavigationHandle* navigation_handle) override; |
| 36 void DidFailProvisionalLoad( | 36 void DidFinishNavigation( |
| 37 content::RenderFrameHost* render_frame_host, | 37 content::NavigationHandle* navigation_handle) override; |
| 38 const GURL& validated_url, | |
| 39 int error_code, | |
| 40 const base::string16& error_description, | |
| 41 bool was_ignored_by_handler) override; | |
| 42 | 38 |
| 43 void RedirectFromOfflineToOnline(const GURL& online_url); | 39 void RedirectFromOfflineToOnline(const GURL& online_url); |
| 44 void RedirectFromOnlineToOffline(const GURL& offline_url); | 40 void RedirectFromOnlineToOffline(const GURL& offline_url); |
| 45 | 41 |
| 46 GURL last_redirect_from_url_; | 42 GURL last_redirect_from_url_; |
| 47 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; | 43 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; |
| 48 | 44 |
| 49 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); | 45 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); |
| 50 }; | 46 }; |
| 51 | 47 |
| 52 } // namespace offline_pages | 48 } // namespace offline_pages |
| 53 | 49 |
| 54 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ | 50 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ |
| OLD | NEW |