Chromium Code Reviews| 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_CACHE = 1 << 1, |
|
Bernhard Bauer
2011/09/05 11:53:01
Is there a reason you're starting with 1 << 1 now?
Mike West
2011/09/05 12:06:14
Because I'm stupid. :) Fixing.
| |
| 60 REMOVE_HISTORY = 1 << 0, | |
| 61 REMOVE_DOWNLOADS = 1 << 1, | |
| 62 REMOVE_COOKIES = 1 << 2, | 61 REMOVE_COOKIES = 1 << 2, |
| 63 REMOVE_PASSWORDS = 1 << 3, | 62 REMOVE_APPCACHE = 1 << 3, |
| 64 REMOVE_FORM_DATA = 1 << 4, | 63 REMOVE_DOWNLOADS = 1 << 4, |
| 65 REMOVE_CACHE = 1 << 5, | 64 REMOVE_FILE_SYSTEMS = 1 << 5, |
| 66 REMOVE_LSO_DATA = 1 << 6, | 65 REMOVE_FORM_DATA = 1 << 6, |
| 66 // In addition to visits, REMOVE_HISTORY removes keywords and last session. | |
| 67 REMOVE_HISTORY = 1 << 7, | |
| 68 REMOVE_INDEXEDDB = 1 << 8, | |
| 69 REMOVE_LOCAL_STORAGE = 1 << 9, | |
| 70 REMOVE_LSO_DATA = 1 << 10, | |
| 71 REMOVE_PASSWORDS = 1 << 11, | |
| 72 REMOVE_WEBSQL = 1 << 12, | |
| 73 | |
| 74 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | |
| 75 // storage, webSQL, and LSO data. | |
| 76 REMOVE_SITE_DATA = (1 << 2) | (1 << 3) | (1 << 5) | (1 << 8) | (1 << 9) | | |
|
Bernhard Bauer
2011/09/05 11:53:01
Can you describe this as an OR'ing of the previous
Mike West
2011/09/05 12:06:14
I didn't even try that, as I assumed it wouldn't c
| |
| 77 (1 << 10) | (1 << 12) | |
| 67 }; | 78 }; |
| 68 | 79 |
| 69 // Observer is notified when the removal is done. Done means keywords have | 80 // Observer is notified when the removal is done. Done means keywords have |
| 70 // been deleted, cache cleared and all other tasks scheduled. | 81 // been deleted, cache cleared and all other tasks scheduled. |
| 71 class Observer { | 82 class Observer { |
| 72 public: | 83 public: |
| 73 virtual void OnBrowsingDataRemoverDone() = 0; | 84 virtual void OnBrowsingDataRemoverDone() = 0; |
| 74 | 85 |
| 75 protected: | 86 protected: |
| 76 virtual ~Observer() {} | 87 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 | 246 // Tracking how many origins need to be deleted, and whether we're finished |
| 236 // gathering origins. | 247 // gathering origins. |
| 237 int quota_managed_origins_to_delete_count_; | 248 int quota_managed_origins_to_delete_count_; |
| 238 int quota_managed_storage_types_to_delete_count_; | 249 int quota_managed_storage_types_to_delete_count_; |
| 239 | 250 |
| 240 ObserverList<Observer> observer_list_; | 251 ObserverList<Observer> observer_list_; |
| 241 | 252 |
| 242 // Used if we need to clear history. | 253 // Used if we need to clear history. |
| 243 CancelableRequestConsumer request_consumer_; | 254 CancelableRequestConsumer request_consumer_; |
| 244 | 255 |
| 256 // Keeps track of whether clearing LSO data is supported. | |
| 257 BooleanPrefMember clear_plugin_lso_data_enabled_; | |
| 258 | |
| 245 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 259 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 246 }; | 260 }; |
| 247 | 261 |
| 248 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 262 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |