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 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/synchronization/waitable_event_watcher.h" | 13 #include "base/synchronization/waitable_event_watcher.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/prefs/pref_member.h" |
15 #include "content/browser/appcache/chrome_appcache_service.h" | 16 #include "content/browser/appcache/chrome_appcache_service.h" |
16 #include "content/browser/cancelable_request.h" | 17 #include "content/browser/cancelable_request.h" |
17 #include "content/common/notification_observer.h" | 18 #include "content/common/notification_observer.h" |
18 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
19 #include "webkit/quota/quota_types.h" | 20 #include "webkit/quota/quota_types.h" |
20 | 21 |
21 class ExtensionSpecialStoragePolicy; | 22 class ExtensionSpecialStoragePolicy; |
22 class IOThread; | 23 class IOThread; |
23 class PluginDataRemover; | 24 class PluginDataRemover; |
24 class Profile; | 25 class Profile; |
(...skipping 24 matching lines...) Expand all Loading... |
49 enum TimePeriod { | 50 enum TimePeriod { |
50 LAST_HOUR = 0, | 51 LAST_HOUR = 0, |
51 LAST_DAY, | 52 LAST_DAY, |
52 LAST_WEEK, | 53 LAST_WEEK, |
53 FOUR_WEEKS, | 54 FOUR_WEEKS, |
54 EVERYTHING | 55 EVERYTHING |
55 }; | 56 }; |
56 | 57 |
57 // Mask used for Remove. | 58 // Mask used for Remove. |
58 enum RemoveDataMask { | 59 enum RemoveDataMask { |
59 // In addition to visits, this removes keywords and the last session. | 60 REMOVE_APPCACHE = 1 << 0, |
60 REMOVE_HISTORY = 1 << 0, | 61 REMOVE_CACHE = 1 << 1, |
61 REMOVE_DOWNLOADS = 1 << 1, | |
62 REMOVE_COOKIES = 1 << 2, | 62 REMOVE_COOKIES = 1 << 2, |
63 REMOVE_PASSWORDS = 1 << 3, | 63 REMOVE_DOWNLOADS = 1 << 3, |
64 REMOVE_FORM_DATA = 1 << 4, | 64 REMOVE_FILE_SYSTEMS = 1 << 4, |
65 REMOVE_CACHE = 1 << 5, | 65 REMOVE_FORM_DATA = 1 << 5, |
66 REMOVE_LSO_DATA = 1 << 6, | 66 // In addition to visits, REMOVE_HISTORY removes keywords and last session. |
| 67 REMOVE_HISTORY = 1 << 6, |
| 68 REMOVE_INDEXEDDB = 1 << 7, |
| 69 REMOVE_LOCAL_STORAGE = 1 << 8, |
| 70 REMOVE_LSO_DATA = 1 << 9, |
| 71 REMOVE_PASSWORDS = 1 << 10, |
| 72 REMOVE_WEBSQL = 1 << 11, |
| 73 |
| 74 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
| 75 // storage, webSQL, and LSO data. |
| 76 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
| 77 REMOVE_INDEXEDDB | REMOVE_LOCAL_STORAGE | |
| 78 REMOVE_LSO_DATA | REMOVE_WEBSQL |
67 }; | 79 }; |
68 | 80 |
69 // Observer is notified when the removal is done. Done means keywords have | 81 // Observer is notified when the removal is done. Done means keywords have |
70 // been deleted, cache cleared and all other tasks scheduled. | 82 // been deleted, cache cleared and all other tasks scheduled. |
71 class Observer { | 83 class Observer { |
72 public: | 84 public: |
73 virtual void OnBrowsingDataRemoverDone() = 0; | 85 virtual void OnBrowsingDataRemoverDone() = 0; |
74 | 86 |
75 protected: | 87 protected: |
76 virtual ~Observer() {} | 88 virtual ~Observer() {} |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Tracking how many origins need to be deleted, and whether we're finished | 247 // Tracking how many origins need to be deleted, and whether we're finished |
236 // gathering origins. | 248 // gathering origins. |
237 int quota_managed_origins_to_delete_count_; | 249 int quota_managed_origins_to_delete_count_; |
238 int quota_managed_storage_types_to_delete_count_; | 250 int quota_managed_storage_types_to_delete_count_; |
239 | 251 |
240 ObserverList<Observer> observer_list_; | 252 ObserverList<Observer> observer_list_; |
241 | 253 |
242 // Used if we need to clear history. | 254 // Used if we need to clear history. |
243 CancelableRequestConsumer request_consumer_; | 255 CancelableRequestConsumer request_consumer_; |
244 | 256 |
| 257 // Keeps track of whether clearing LSO data is supported. |
| 258 BooleanPrefMember clear_plugin_lso_data_enabled_; |
| 259 |
245 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 260 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
246 }; | 261 }; |
247 | 262 |
248 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 263 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |