| 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 "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 explicit OfflinePageTabHelper(content::WebContents* web_contents); | 72 explicit OfflinePageTabHelper(content::WebContents* web_contents); |
| 73 | 73 |
| 74 // Overridden from content::WebContentsObserver: | 74 // Overridden from content::WebContentsObserver: |
| 75 void DidStartNavigation( | 75 void DidStartNavigation( |
| 76 content::NavigationHandle* navigation_handle) override; | 76 content::NavigationHandle* navigation_handle) override; |
| 77 void DidFinishNavigation( | 77 void DidFinishNavigation( |
| 78 content::NavigationHandle* navigation_handle) override; | 78 content::NavigationHandle* navigation_handle) override; |
| 79 | 79 |
| 80 void SelectPageForOnlineURLDone(const OfflinePageItem* offline_page); | 80 void SelectPageForURLDone(const OfflinePageItem* offline_page); |
| 81 | 81 |
| 82 // The provisional info about the offline page being loaded. This is set when | 82 // The provisional info about the offline page being loaded. This is set when |
| 83 // the offline interceptor decides to serve the offline page and it will be | 83 // the offline interceptor decides to serve the offline page and it will be |
| 84 // moved to |offline_info_| once the navigation is committed without error. | 84 // moved to |offline_info_| once the navigation is committed without error. |
| 85 LoadedOfflinePageInfo provisional_offline_info_; | 85 LoadedOfflinePageInfo provisional_offline_info_; |
| 86 | 86 |
| 87 // The info about offline page being loaded. This is set from | 87 // The info about offline page being loaded. This is set from |
| 88 // |provisional_offline_info_| when the navigation is committed without error. | 88 // |provisional_offline_info_| when the navigation is committed without error. |
| 89 // This can be used to by the Tab to synchronously ask about the offline | 89 // This can be used to by the Tab to synchronously ask about the offline |
| 90 // info. | 90 // info. |
| 91 LoadedOfflinePageInfo offline_info_; | 91 LoadedOfflinePageInfo offline_info_; |
| 92 | 92 |
| 93 bool reloading_url_on_net_error_ = false; | 93 bool reloading_url_on_net_error_ = false; |
| 94 | 94 |
| 95 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; | 95 base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); | 97 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace offline_pages | 100 } // namespace offline_pages |
| 101 | 101 |
| 102 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ | 102 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_ |
| OLD | NEW |