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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // This is set to true if the ongoing snapshot for downloads is waiting on the | 126 // This is set to true if the ongoing snapshot for downloads is waiting on the |
127 // page to reach a minimal quality level to start. | 127 // page to reach a minimal quality level to start. |
128 bool downloads_snapshot_on_hold_ = false; | 128 bool downloads_snapshot_on_hold_ = false; |
129 | 129 |
130 // Snapshot information for the last successful snapshot requested by | 130 // Snapshot information for the last successful snapshot requested by |
131 // downloads. Null if no successful one has ever completed for the current | 131 // downloads. Null if no successful one has ever completed for the current |
132 // page. | 132 // page. |
133 std::unique_ptr<SnapshotProgressInfo> downloads_latest_saved_snapshot_info_; | 133 std::unique_ptr<SnapshotProgressInfo> downloads_latest_saved_snapshot_info_; |
134 | 134 |
135 // Snapshot progress information for a last_n triggered request. Null if | 135 // Snapshot progress information for a last_n triggered request. Null if |
136 // last_n is not currently capturing the current page. | 136 // last_n is not currently capturing the current page. It is cleared upon non |
| 137 // ignored navigations. |
137 std::unique_ptr<SnapshotProgressInfo> last_n_ongoing_snapshot_info_; | 138 std::unique_ptr<SnapshotProgressInfo> last_n_ongoing_snapshot_info_; |
138 | 139 |
139 // Snapshot information for the last successful snapshot requested by | 140 // Snapshot information for the last successful snapshot requested by |
140 // last_n. Null if no successful one has ever completed for the current page. | 141 // last_n. Null if no successful one has ever completed for the current page. |
| 142 // It is cleared when the referenced snapshot is deleted. |
141 std::unique_ptr<SnapshotProgressInfo> last_n_latest_saved_snapshot_info_; | 143 std::unique_ptr<SnapshotProgressInfo> last_n_latest_saved_snapshot_info_; |
142 | 144 |
143 // If empty, the tab does not have AndroidId and can not capture pages. | 145 // If empty, the tab does not have AndroidId and can not capture pages. |
144 std::string tab_id_; | 146 std::string tab_id_; |
145 | 147 |
146 // Monitors page loads and starts snapshots when a download request exist. It | 148 // Monitors page loads and starts snapshots when a download request exist. It |
147 // is also used as an initialization flag for EnsureInitialized() to be run | 149 // is also used as an initialization flag for EnsureInitialized() to be run |
148 // only once. | 150 // only once. |
149 std::unique_ptr<SnapshotController> snapshot_controller_; | 151 std::unique_ptr<SnapshotController> snapshot_controller_; |
150 | 152 |
151 std::unique_ptr<Delegate> delegate_; | 153 std::unique_ptr<Delegate> delegate_; |
152 | 154 |
153 // Set at each navigation to control if last_n should save snapshots of the | 155 // Set at each navigation to control if last_n should save snapshots of the |
154 // current page being loaded. | 156 // current page being loaded. |
155 bool last_n_listen_to_tab_hidden_ = false; | 157 bool last_n_listen_to_tab_hidden_ = false; |
156 | 158 |
157 // Set to true when the tab containing the associated WebContents is in the | 159 // Set to true when the tab containing the associated WebContents is in the |
158 // process of being closed. | 160 // process of being closed. |
159 bool tab_is_closing_ = false; | 161 bool tab_is_closing_ = false; |
160 | 162 |
161 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 163 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
162 | 164 |
163 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 165 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
164 }; | 166 }; |
165 | 167 |
166 } // namespace offline_pages | 168 } // namespace offline_pages |
167 | 169 |
168 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 170 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
OLD | NEW |