| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class BrowsingDataRemover : public content::NotificationObserver, | 50 class BrowsingDataRemover : public content::NotificationObserver, |
| 51 public base::WaitableEventWatcher::Delegate, | 51 public base::WaitableEventWatcher::Delegate, |
| 52 public PepperFlashSettingsManager::Client { | 52 public PepperFlashSettingsManager::Client { |
| 53 public: | 53 public: |
| 54 // Time period ranges available when doing browsing data removals. | 54 // Time period ranges available when doing browsing data removals. |
| 55 enum TimePeriod { | 55 enum TimePeriod { |
| 56 LAST_HOUR = 0, | 56 LAST_HOUR = 0, |
| 57 LAST_DAY, | 57 LAST_DAY, |
| 58 LAST_WEEK, | 58 LAST_WEEK, |
| 59 FOUR_WEEKS, | 59 FOUR_WEEKS, |
| 60 EXCEPT_LAST_HOUR, |
| 61 EXCEPT_LAST_DAY, |
| 62 EXCEPT_LAST_WEEK, |
| 63 EXCEPT_FOUR_WEEKS, |
| 60 EVERYTHING | 64 EVERYTHING |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 // Mask used for Remove. | 67 // Mask used for Remove. |
| 64 enum RemoveDataMask { | 68 enum RemoveDataMask { |
| 65 REMOVE_APPCACHE = 1 << 0, | 69 REMOVE_APPCACHE = 1 << 0, |
| 66 REMOVE_CACHE = 1 << 1, | 70 REMOVE_CACHE = 1 << 1, |
| 67 REMOVE_COOKIES = 1 << 2, | 71 REMOVE_COOKIES = 1 << 2, |
| 68 REMOVE_DOWNLOADS = 1 << 3, | 72 REMOVE_DOWNLOADS = 1 << 3, |
| 69 REMOVE_FILE_SYSTEMS = 1 << 4, | 73 REMOVE_FILE_SYSTEMS = 1 << 4, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 virtual ~Observer() {} | 121 virtual ~Observer() {} |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 // Creates a BrowsingDataRemover to remove browser data from the specified | 124 // Creates a BrowsingDataRemover to remove browser data from the specified |
| 121 // profile in the specified time range. Use Remove to initiate the removal. | 125 // profile in the specified time range. Use Remove to initiate the removal. |
| 122 BrowsingDataRemover(Profile* profile, base::Time delete_begin, | 126 BrowsingDataRemover(Profile* profile, base::Time delete_begin, |
| 123 base::Time delete_end); | 127 base::Time delete_end); |
| 124 | 128 |
| 125 // Creates a BrowsingDataRemover to remove browser data from the specified | 129 // Creates a BrowsingDataRemover to remove browser data from the specified |
| 126 // profile in the specified time range. | 130 // profile in the specified time range. |
| 127 BrowsingDataRemover(Profile* profile, TimePeriod time_period, | 131 BrowsingDataRemover(Profile* profile, TimePeriod time_period); |
| 128 base::Time delete_end); | |
| 129 | 132 |
| 130 // Removes the specified items related to browsing for all origins that match | 133 // Removes the specified items related to browsing for all origins that match |
| 131 // the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask). | 134 // the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask). |
| 132 void Remove(int remove_mask, int origin_set_mask); | 135 void Remove(int remove_mask, int origin_set_mask); |
| 133 | 136 |
| 134 void AddObserver(Observer* observer); | 137 void AddObserver(Observer* observer); |
| 135 void RemoveObserver(Observer* observer); | 138 void RemoveObserver(Observer* observer); |
| 136 | 139 |
| 137 // Called when history deletion is done. | 140 // Called when history deletion is done. |
| 138 void OnHistoryDeletionDone(); | 141 void OnHistoryDeletionDone(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 void ClearServerBoundCertsOnIOThread( | 279 void ClearServerBoundCertsOnIOThread( |
| 277 net::URLRequestContextGetter* rq_context); | 280 net::URLRequestContextGetter* rq_context); |
| 278 | 281 |
| 279 // Callback when server bound certs have been deleted. Invokes | 282 // Callback when server bound certs have been deleted. Invokes |
| 280 // NotifyAndDeleteIfDone. | 283 // NotifyAndDeleteIfDone. |
| 281 void OnClearedServerBoundCerts(); | 284 void OnClearedServerBoundCerts(); |
| 282 | 285 |
| 283 // Calculate the begin time for the deletion range specified by |time_period|. | 286 // Calculate the begin time for the deletion range specified by |time_period|. |
| 284 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 287 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
| 285 | 288 |
| 289 // Calculate the end time for the deletion range specified by |time_period|. |
| 290 base::Time CalculateEndDeleteTime(TimePeriod time_period); |
| 291 |
| 286 // Returns true if we're all done. | 292 // Returns true if we're all done. |
| 287 bool AllDone(); | 293 bool AllDone(); |
| 288 | 294 |
| 289 // Setter for removing_; DCHECKs that we can only start removing if we're not | 295 // Setter for removing_; DCHECKs that we can only start removing if we're not |
| 290 // already removing, and vice-versa. | 296 // already removing, and vice-versa. |
| 291 static void set_removing(bool removing); | 297 static void set_removing(bool removing); |
| 292 | 298 |
| 293 content::NotificationRegistrar registrar_; | 299 content::NotificationRegistrar registrar_; |
| 294 | 300 |
| 295 // Profile we're to remove from. | 301 // Profile we're to remove from. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 365 |
| 360 ObserverList<Observer> observer_list_; | 366 ObserverList<Observer> observer_list_; |
| 361 | 367 |
| 362 // Used if we need to clear history. | 368 // Used if we need to clear history. |
| 363 CancelableRequestConsumer request_consumer_; | 369 CancelableRequestConsumer request_consumer_; |
| 364 | 370 |
| 365 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 371 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 366 }; | 372 }; |
| 367 | 373 |
| 368 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 374 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |