| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/cancelable_request.h" | 10 #include "chrome/browser/cancelable_request.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Creates a BrowsingDataRemover to remove browser data from the specified | 46 // Creates a BrowsingDataRemover to remove browser data from the specified |
| 47 // profile in the specified time range. Use Remove to initiate the removal. | 47 // profile in the specified time range. Use Remove to initiate the removal. |
| 48 BrowsingDataRemover(Profile* profile, base::Time delete_begin, | 48 BrowsingDataRemover(Profile* profile, base::Time delete_begin, |
| 49 base::Time delete_end); | 49 base::Time delete_end); |
| 50 | 50 |
| 51 // Creates a BrowsingDataRemover to remove browser data from the specified | 51 // Creates a BrowsingDataRemover to remove browser data from the specified |
| 52 // profile in the specified time range. | 52 // profile in the specified time range. |
| 53 BrowsingDataRemover(Profile* profile, TimePeriod time_period, | 53 BrowsingDataRemover(Profile* profile, TimePeriod time_period, |
| 54 base::Time delete_end); | 54 base::Time delete_end); |
| 55 ~BrowsingDataRemover(); | |
| 56 | 55 |
| 57 // Removes the specified items related to browsing. | 56 // Removes the specified items related to browsing. |
| 58 void Remove(int remove_mask); | 57 void Remove(int remove_mask); |
| 59 | 58 |
| 60 void AddObserver(Observer* observer); | 59 void AddObserver(Observer* observer); |
| 61 void RemoveObserver(Observer* observer); | 60 void RemoveObserver(Observer* observer); |
| 62 | 61 |
| 63 // Called when history deletion is done. | 62 // Called when history deletion is done. |
| 64 void OnHistoryDeletionDone(); | 63 void OnHistoryDeletionDone(); |
| 65 | 64 |
| 66 static bool is_removing() { return removing_; } | 65 static bool is_removing() { return removing_; } |
| 67 | 66 |
| 68 private: | 67 private: |
| 68 // BrowsingDataRemover deletes itself (using DeleteTask) and is not supposed |
| 69 // to be deleted by other objects so make destructor private and DeleteTask |
| 70 // a friend. |
| 71 friend class DeleteTask<BrowsingDataRemover>; |
| 72 ~BrowsingDataRemover(); |
| 73 |
| 69 // NotificationObserver method. Callback when TemplateURLModel has finished | 74 // NotificationObserver method. Callback when TemplateURLModel has finished |
| 70 // loading. Deletes the entries from the model, and if we're not waiting on | 75 // loading. Deletes the entries from the model, and if we're not waiting on |
| 71 // anything else notifies observers and deletes this BrowsingDataRemover. | 76 // anything else notifies observers and deletes this BrowsingDataRemover. |
| 72 void Observe(NotificationType type, | 77 void Observe(NotificationType type, |
| 73 const NotificationSource& source, | 78 const NotificationSource& source, |
| 74 const NotificationDetails& details); | 79 const NotificationDetails& details); |
| 75 | 80 |
| 76 // If we're not waiting on anything, notifies observers and deletes this | 81 // If we're not waiting on anything, notifies observers and deletes this |
| 77 // object. | 82 // object. |
| 78 void NotifyAndDeleteIfDone(); | 83 void NotifyAndDeleteIfDone(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 121 |
| 117 ObserverList<Observer> observer_list_; | 122 ObserverList<Observer> observer_list_; |
| 118 | 123 |
| 119 // Used if we need to clear history. | 124 // Used if we need to clear history. |
| 120 CancelableRequestConsumer request_consumer_; | 125 CancelableRequestConsumer request_consumer_; |
| 121 | 126 |
| 122 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 127 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 130 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |