OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // Invoked on the IO thread to delete from the AppCache. | 164 // Invoked on the IO thread to delete from the AppCache. |
165 void ClearAppCacheOnIOThread(); | 165 void ClearAppCacheOnIOThread(); |
166 | 166 |
167 // Lower level helpers. | 167 // Lower level helpers. |
168 void OnGotAppCacheInfo(int rv); | 168 void OnGotAppCacheInfo(int rv); |
169 void OnAppCacheDeleted(int rv); | 169 void OnAppCacheDeleted(int rv); |
170 | 170 |
171 // Callback when Gears data has been deleted. Invokes NotifyAndDeleteIfDone. | 171 // Callback when Gears data has been deleted. Invokes NotifyAndDeleteIfDone. |
172 void OnClearedGearsData(); | 172 void OnClearedGearsData(); |
173 | 173 |
| 174 // Callback when Cookies has been deleted. Invokes NotifyAndDeleteIfDone. |
| 175 void OnCookiesDeleted(int num_deleted); |
| 176 |
174 // Invoked on the FILE thread to delete old Gears data. | 177 // Invoked on the FILE thread to delete old Gears data. |
175 void ClearGearsDataOnFILEThread(const FilePath& profile_dir); | 178 void ClearGearsDataOnFILEThread(const FilePath& profile_dir); |
176 | 179 |
177 // Calculate the begin time for the deletion range specified by |time_period|. | 180 // Calculate the begin time for the deletion range specified by |time_period|. |
178 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 181 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
179 | 182 |
180 // Returns true if we're all done. | 183 // Returns true if we're all done. |
181 bool all_done() { | 184 bool all_done() { |
182 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && | 185 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && |
183 !waiting_for_clear_history_ && | 186 !waiting_for_clear_history_ && |
| 187 !waiting_for_clear_cookies_&& |
184 !waiting_for_clear_networking_history_ && | 188 !waiting_for_clear_networking_history_ && |
185 !waiting_for_clear_databases_ && !waiting_for_clear_appcache_ && | 189 !waiting_for_clear_databases_ && !waiting_for_clear_appcache_ && |
186 !waiting_for_clear_lso_data_ && !waiting_for_clear_gears_data_ && | 190 !waiting_for_clear_lso_data_ && !waiting_for_clear_gears_data_ && |
187 !waiting_for_clear_file_systems_; | 191 !waiting_for_clear_file_systems_; |
188 } | 192 } |
189 | 193 |
190 NotificationRegistrar registrar_; | 194 NotificationRegistrar registrar_; |
191 | 195 |
192 // Profile we're to remove from. | 196 // Profile we're to remove from. |
193 Profile* profile_; | 197 Profile* profile_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; | 230 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; |
227 | 231 |
228 // Used to delete plugin data. | 232 // Used to delete plugin data. |
229 scoped_refptr<PluginDataRemover> plugin_data_remover_; | 233 scoped_refptr<PluginDataRemover> plugin_data_remover_; |
230 base::WaitableEventWatcher watcher_; | 234 base::WaitableEventWatcher watcher_; |
231 | 235 |
232 // True if we're waiting for various data to be deleted. | 236 // True if we're waiting for various data to be deleted. |
233 bool waiting_for_clear_databases_; | 237 bool waiting_for_clear_databases_; |
234 bool waiting_for_clear_history_; | 238 bool waiting_for_clear_history_; |
235 bool waiting_for_clear_networking_history_; | 239 bool waiting_for_clear_networking_history_; |
| 240 bool waiting_for_clear_cookies_; |
236 bool waiting_for_clear_cache_; | 241 bool waiting_for_clear_cache_; |
237 bool waiting_for_clear_appcache_; | 242 bool waiting_for_clear_appcache_; |
238 bool waiting_for_clear_lso_data_; | 243 bool waiting_for_clear_lso_data_; |
239 bool waiting_for_clear_gears_data_; | 244 bool waiting_for_clear_gears_data_; |
240 bool waiting_for_clear_file_systems_; | 245 bool waiting_for_clear_file_systems_; |
241 | 246 |
242 ObserverList<Observer> observer_list_; | 247 ObserverList<Observer> observer_list_; |
243 | 248 |
244 // Used if we need to clear history. | 249 // Used if we need to clear history. |
245 CancelableRequestConsumer request_consumer_; | 250 CancelableRequestConsumer request_consumer_; |
246 | 251 |
247 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 252 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
248 }; | 253 }; |
249 | 254 |
250 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 255 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |