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 "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 const OfflinePageItem* offline_page() { | 36 const OfflinePageItem* offline_page() { |
| 37 return offline_info_.offline_page.get(); | 37 return offline_info_.offline_page.get(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 const OfflinePageHeader& offline_header() const { | 40 const OfflinePageHeader& offline_header() const { |
| 41 return offline_info_.offline_header; | 41 return offline_info_.offline_header; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Whether the page is an offline preview. | 44 // Whether the page is an offline preview. |
| 45 bool is_offline_preview() const { return offline_info_.is_offline_preview; } | 45 bool IsOfflinePreview() const; |
|
jianli
2016/10/25 22:14:16
nit: rename to IsShowingOfflinePreview in order to
RyanSturm
2016/10/25 23:08:26
Done.
| |
| 46 | 46 |
| 47 // Returns provisional offline page since actual navigation does not happen | 47 // Returns provisional offline page since actual navigation does not happen |
| 48 // during unit tests. | 48 // during unit tests. |
| 49 const OfflinePageItem* GetOfflinePageForTest() const; | 49 const OfflinePageItem* GetOfflinePageForTest() const; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 friend class content::WebContentsUserData<OfflinePageTabHelper>; | 52 friend class content::WebContentsUserData<OfflinePageTabHelper>; |
| 53 | 53 |
| 54 // Contains the info about the offline page being loaded. | 54 // Contains the info about the offline page being loaded. |
| 55 struct LoadedOfflinePageInfo { | 55 struct LoadedOfflinePageInfo { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |