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_RECENT_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 // Note #2: Currently this method only accepts download requests from the | 80 // Note #2: Currently this method only accepts download requests from the |
| 81 // downloads namespace. | 81 // downloads namespace. |
| 82 void ObserveAndDownloadCurrentPage(const ClientId& client_id, | 82 void ObserveAndDownloadCurrentPage(const ClientId& client_id, |
| 83 int64_t request_id); | 83 int64_t request_id); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 struct SnapshotProgressInfo; | 86 struct SnapshotProgressInfo; |
| 87 | 87 |
| 88 explicit RecentTabHelper(content::WebContents* web_contents); | 88 explicit RecentTabHelper(content::WebContents* web_contents); |
| 89 friend class content::WebContentsUserData<RecentTabHelper>; | 89 friend class content::WebContentsUserData<RecentTabHelper>; |
| 90 FRIEND_TEST_ALL_PREFIXES(RecentTabHelperTest, LastNDisabledOnSvelte); | |
|
Dmitry Titov
2017/02/16 20:58:41
Could we add a getter on Delegate to return whethe
carlosk
2017/02/16 21:48:16
Done. I also added a getter for the initial test d
| |
| 90 | 91 |
| 91 bool EnsureInitialized(); | 92 bool EnsureInitialized(); |
| 92 void ContinueSnapshotWithIdsToPurge(SnapshotProgressInfo* snapshot_info, | 93 void ContinueSnapshotWithIdsToPurge(SnapshotProgressInfo* snapshot_info, |
| 93 const std::vector<int64_t>& page_ids); | 94 const std::vector<int64_t>& page_ids); |
| 94 void ContinueSnapshotAfterPurge(SnapshotProgressInfo* snapshot_info, | 95 void ContinueSnapshotAfterPurge(SnapshotProgressInfo* snapshot_info, |
| 95 OfflinePageModel::DeletePageResult result); | 96 OfflinePageModel::DeletePageResult result); |
| 96 void SavePageCallback(SnapshotProgressInfo* snapshot_info, | 97 void SavePageCallback(SnapshotProgressInfo* snapshot_info, |
| 97 OfflinePageModel::SavePageResult result, | 98 OfflinePageModel::SavePageResult result, |
| 98 int64_t offline_id); | 99 int64_t offline_id); |
| 99 void ReportSnapshotCompleted(SnapshotProgressInfo* snapshot_info, | 100 void ReportSnapshotCompleted(SnapshotProgressInfo* snapshot_info, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 | 146 |
| 146 // Set at each navigation to control if last_n should save snapshots of the | 147 // Set at each navigation to control if last_n should save snapshots of the |
| 147 // current page being loaded. | 148 // current page being loaded. |
| 148 bool last_n_listen_to_tab_hidden_ = false; | 149 bool last_n_listen_to_tab_hidden_ = false; |
| 149 | 150 |
| 150 // Track the page quality status of the last saved snapshot for the current | 151 // Track the page quality status of the last saved snapshot for the current |
| 151 // page. It is generally reset upon new navigations. | 152 // page. It is generally reset upon new navigations. |
| 152 SnapshotController::PageQuality last_n_latest_saved_quality_ = | 153 SnapshotController::PageQuality last_n_latest_saved_quality_ = |
| 153 SnapshotController::PageQuality::POOR; | 154 SnapshotController::PageQuality::POOR; |
| 154 | 155 |
| 156 // Cached value of whether low end device. Overwritable for testing. | |
| 157 bool is_low_end_device_; | |
| 158 | |
| 155 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 159 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
| 156 | 160 |
| 157 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 161 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
| 158 }; | 162 }; |
| 159 | 163 |
| 160 } // namespace offline_pages | 164 } // namespace offline_pages |
| 161 | 165 |
| 162 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 166 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| OLD | NEW |