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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void Remove(int remove_mask); | 84 void Remove(int remove_mask); |
85 | 85 |
86 void AddObserver(Observer* observer); | 86 void AddObserver(Observer* observer); |
87 void RemoveObserver(Observer* observer); | 87 void RemoveObserver(Observer* observer); |
88 | 88 |
89 // Called when history deletion is done. | 89 // Called when history deletion is done. |
90 void OnHistoryDeletionDone(); | 90 void OnHistoryDeletionDone(); |
91 | 91 |
92 static bool is_removing() { return removing_; } | 92 static bool is_removing() { return removing_; } |
93 | 93 |
| 94 // Removes the Gears plugin data. |
| 95 static void ClearGearsData(const FilePath& profile_dir); |
| 96 |
94 private: | 97 private: |
95 enum CacheState { | 98 enum CacheState { |
96 STATE_NONE, | 99 STATE_NONE, |
97 STATE_CREATE_MAIN, | 100 STATE_CREATE_MAIN, |
98 STATE_CREATE_MEDIA, | 101 STATE_CREATE_MEDIA, |
99 STATE_DELETE_MAIN, | 102 STATE_DELETE_MAIN, |
100 STATE_DELETE_MEDIA, | 103 STATE_DELETE_MEDIA, |
101 STATE_DONE | 104 STATE_DONE |
102 }; | 105 }; |
103 | 106 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void OnClearedAppCache(); | 154 void OnClearedAppCache(); |
152 | 155 |
153 // Invoked on the IO thread to delete from the AppCache. | 156 // Invoked on the IO thread to delete from the AppCache. |
154 void ClearAppCacheOnIOThread(); | 157 void ClearAppCacheOnIOThread(); |
155 | 158 |
156 // Lower level helpers. | 159 // Lower level helpers. |
157 void OnGotAppCacheInfo(int rv); | 160 void OnGotAppCacheInfo(int rv); |
158 void OnAppCacheDeleted(int rv); | 161 void OnAppCacheDeleted(int rv); |
159 ChromeAppCacheService* GetAppCacheService(); | 162 ChromeAppCacheService* GetAppCacheService(); |
160 | 163 |
| 164 // Callback when Gears data has been deleted. Invokes NotifyAndDeleteIfDone. |
| 165 void OnClearedGearsData(); |
| 166 |
| 167 // Invoked on the FILE thread to delete old Gears data. |
| 168 void ClearGearsDataOnFILEThread(const FilePath& profile_dir); |
| 169 |
161 // Calculate the begin time for the deletion range specified by |time_period|. | 170 // Calculate the begin time for the deletion range specified by |time_period|. |
162 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 171 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
163 | 172 |
164 // Returns true if we're all done. | 173 // Returns true if we're all done. |
165 bool all_done() { | 174 bool all_done() { |
166 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && | 175 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && |
167 !waiting_for_clear_history_ && | 176 !waiting_for_clear_history_ && |
168 !waiting_for_clear_networking_history_ && | 177 !waiting_for_clear_networking_history_ && |
169 !waiting_for_clear_databases_ && !waiting_for_clear_appcache_ && | 178 !waiting_for_clear_databases_ && !waiting_for_clear_appcache_ && |
170 !waiting_for_clear_lso_data_; | 179 !waiting_for_clear_lso_data_ && !waiting_for_clear_gears_data_; |
171 } | 180 } |
172 | 181 |
173 NotificationRegistrar registrar_; | 182 NotificationRegistrar registrar_; |
174 | 183 |
175 // Profile we're to remove from. | 184 // Profile we're to remove from. |
176 Profile* profile_; | 185 Profile* profile_; |
177 | 186 |
178 // 'Protected' origins are not subject to data removal. | 187 // 'Protected' origins are not subject to data removal. |
179 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; | 188 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; |
180 | 189 |
(...skipping 30 matching lines...) Expand all Loading... |
211 scoped_refptr<PluginDataRemover> plugin_data_remover_; | 220 scoped_refptr<PluginDataRemover> plugin_data_remover_; |
212 base::WaitableEventWatcher watcher_; | 221 base::WaitableEventWatcher watcher_; |
213 | 222 |
214 // True if we're waiting for various data to be deleted. | 223 // True if we're waiting for various data to be deleted. |
215 bool waiting_for_clear_databases_; | 224 bool waiting_for_clear_databases_; |
216 bool waiting_for_clear_history_; | 225 bool waiting_for_clear_history_; |
217 bool waiting_for_clear_networking_history_; | 226 bool waiting_for_clear_networking_history_; |
218 bool waiting_for_clear_cache_; | 227 bool waiting_for_clear_cache_; |
219 bool waiting_for_clear_appcache_; | 228 bool waiting_for_clear_appcache_; |
220 bool waiting_for_clear_lso_data_; | 229 bool waiting_for_clear_lso_data_; |
| 230 bool waiting_for_clear_gears_data_; |
221 | 231 |
222 ObserverList<Observer> observer_list_; | 232 ObserverList<Observer> observer_list_; |
223 | 233 |
224 // Used if we need to clear history. | 234 // Used if we need to clear history. |
225 CancelableRequestConsumer request_consumer_; | 235 CancelableRequestConsumer request_consumer_; |
226 | 236 |
227 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 237 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
228 }; | 238 }; |
229 | 239 |
230 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 240 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |