| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // profile in the specified time range. Use Remove to initiate the removal. | 113 // profile in the specified time range. Use Remove to initiate the removal. |
| 114 BrowsingDataRemover(Profile* profile, base::Time delete_begin, | 114 BrowsingDataRemover(Profile* profile, base::Time delete_begin, |
| 115 base::Time delete_end); | 115 base::Time delete_end); |
| 116 | 116 |
| 117 // Creates a BrowsingDataRemover to remove browser data from the specified | 117 // Creates a BrowsingDataRemover to remove browser data from the specified |
| 118 // profile in the specified time range. | 118 // profile in the specified time range. |
| 119 BrowsingDataRemover(Profile* profile, TimePeriod time_period, | 119 BrowsingDataRemover(Profile* profile, TimePeriod time_period, |
| 120 base::Time delete_end); | 120 base::Time delete_end); |
| 121 | 121 |
| 122 // Removes the specified items related to browsing for all origins. | 122 // Removes the specified items related to browsing for all origins. |
| 123 void Remove(int remove_mask); | 123 void Remove(int remove_mask, bool include_protected_origins); |
| 124 | 124 |
| 125 void AddObserver(Observer* observer); | 125 void AddObserver(Observer* observer); |
| 126 void RemoveObserver(Observer* observer); | 126 void RemoveObserver(Observer* observer); |
| 127 | 127 |
| 128 // Called when history deletion is done. | 128 // Called when history deletion is done. |
| 129 void OnHistoryDeletionDone(); | 129 void OnHistoryDeletionDone(); |
| 130 | 130 |
| 131 // Quota managed data uses a different bitmask for types than | 131 // Quota managed data uses a different bitmask for types than |
| 132 // BrowsingDataRemover uses. This method generates that mask. | 132 // BrowsingDataRemover uses. This method generates that mask. |
| 133 static int GenerateQuotaClientMask(int remove_mask); | 133 static int GenerateQuotaClientMask(int remove_mask); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 const content::NotificationSource& source, | 173 const content::NotificationSource& source, |
| 174 const content::NotificationDetails& details) OVERRIDE; | 174 const content::NotificationDetails& details) OVERRIDE; |
| 175 | 175 |
| 176 // WaitableEventWatcher implementation. | 176 // WaitableEventWatcher implementation. |
| 177 // Called when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone. | 177 // Called when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone. |
| 178 virtual void OnWaitableEventSignaled( | 178 virtual void OnWaitableEventSignaled( |
| 179 base::WaitableEvent* waitable_event) OVERRIDE; | 179 base::WaitableEvent* waitable_event) OVERRIDE; |
| 180 | 180 |
| 181 // Removes the specified items related to browsing for a specific host. If the | 181 // Removes the specified items related to browsing for a specific host. If the |
| 182 // provided |origin| is empty, data is removed for all origins. If | 182 // provided |origin| is empty, data is removed for all origins. If |
| 183 // |remove_protected_origins| is true, then data is removed even if the origin | 183 // |include_protected_origins| is true, then data is removed even if the |
| 184 // is otherwise protected (e.g. as an installed application). | 184 // origin is otherwise protected (e.g. as an installed application). |
| 185 void RemoveImpl(int remove_mask, | 185 void RemoveImpl(int remove_mask, |
| 186 const GURL& origin, | 186 const GURL& origin, |
| 187 bool remove_protected_origins); | 187 bool include_protected_origins); |
| 188 | 188 |
| 189 // If we're not waiting on anything, notifies observers and deletes this | 189 // If we're not waiting on anything, notifies observers and deletes this |
| 190 // object. | 190 // object. |
| 191 void NotifyAndDeleteIfDone(); | 191 void NotifyAndDeleteIfDone(); |
| 192 | 192 |
| 193 // Callback when the network history has been deleted. Invokes | 193 // Callback when the network history has been deleted. Invokes |
| 194 // NotifyAndDeleteIfDone. | 194 // NotifyAndDeleteIfDone. |
| 195 void ClearedNetworkHistory(); | 195 void ClearedNetworkHistory(); |
| 196 | 196 |
| 197 // Invoked on the IO thread to clear the HostCache, speculative data about | 197 // Invoked on the IO thread to clear the HostCache, speculative data about |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 int quota_managed_origins_to_delete_count_; | 309 int quota_managed_origins_to_delete_count_; |
| 310 int quota_managed_storage_types_to_delete_count_; | 310 int quota_managed_storage_types_to_delete_count_; |
| 311 | 311 |
| 312 // The removal mask for the current removal operation. | 312 // The removal mask for the current removal operation. |
| 313 int remove_mask_; | 313 int remove_mask_; |
| 314 | 314 |
| 315 // The origin for the current removal operation. | 315 // The origin for the current removal operation. |
| 316 GURL remove_origin_; | 316 GURL remove_origin_; |
| 317 | 317 |
| 318 // Should data for protected origins be removed? | 318 // Should data for protected origins be removed? |
| 319 bool remove_protected_; | 319 bool include_protected_; |
| 320 | 320 |
| 321 ObserverList<Observer> observer_list_; | 321 ObserverList<Observer> observer_list_; |
| 322 | 322 |
| 323 // Used if we need to clear history. | 323 // Used if we need to clear history. |
| 324 CancelableRequestConsumer request_consumer_; | 324 CancelableRequestConsumer request_consumer_; |
| 325 | 325 |
| 326 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 326 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 329 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |