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