Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/android/offline_pages/recent_tab_helper.h

Issue 2825973002: Revert of Last_n: Delete previously saved snapshot when navigating. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 for the current 131 // downloads. Null if no successful one has ever completed.
132 // page.
133 std::unique_ptr<SnapshotProgressInfo> downloads_latest_saved_snapshot_info_; 132 std::unique_ptr<SnapshotProgressInfo> downloads_latest_saved_snapshot_info_;
134 133
135 // Snapshot progress information for a last_n triggered request. Null if 134 // Snapshot progress information for a last_n triggered request. Null if
136 // last_n is not currently capturing the current page. 135 // last_n is not currently capturing the current page.
137 std::unique_ptr<SnapshotProgressInfo> last_n_ongoing_snapshot_info_; 136 std::unique_ptr<SnapshotProgressInfo> last_n_ongoing_snapshot_info_;
138 137
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
143 // If empty, the tab does not have AndroidId and can not capture pages. 138 // If empty, the tab does not have AndroidId and can not capture pages.
144 std::string tab_id_; 139 std::string tab_id_;
145 140
146 // Monitors page loads and starts snapshots when a download request exist. It 141 // 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 142 // is also used as an initialization flag for EnsureInitialized() to be run
148 // only once. 143 // only once.
149 std::unique_ptr<SnapshotController> snapshot_controller_; 144 std::unique_ptr<SnapshotController> snapshot_controller_;
150 145
151 std::unique_ptr<Delegate> delegate_; 146 std::unique_ptr<Delegate> delegate_;
152 147
153 // Set at each navigation to control if last_n should save snapshots of the 148 // Set at each navigation to control if last_n should save snapshots of the
154 // current page being loaded. 149 // current page being loaded.
155 bool last_n_listen_to_tab_hidden_ = false; 150 bool last_n_listen_to_tab_hidden_ = false;
156 151
157 // Set to true when the tab containing the associated WebContents is in the 152 // Set to true when the tab containing the associated WebContents is in the
158 // process of being closed. 153 // process of being closed.
159 bool tab_is_closing_ = false; 154 bool tab_is_closing_ = false;
160 155
161 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; 156 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_;
162 157
163 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); 158 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper);
164 }; 159 };
165 160
166 } // namespace offline_pages 161 } // namespace offline_pages
167 162
168 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ 163 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698