Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1065)

Side by Side Diff: chrome/browser/browsing_data_remover.h

Issue 10413072: Teaching BrowsingDataRemover how to delete application data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
50 public: 50 public:
51 // Time period ranges available when doing browsing data removals. 51 // Time period ranges available when doing browsing data removals.
52 enum TimePeriod { 52 enum TimePeriod {
53 LAST_HOUR = 0, 53 LAST_HOUR = 0,
54 LAST_DAY, 54 LAST_DAY,
55 LAST_WEEK, 55 LAST_WEEK,
56 FOUR_WEEKS, 56 FOUR_WEEKS,
57 EVERYTHING 57 EVERYTHING
58 }; 58 };
59 59
60 enum RemoveOriginSet {
61 REMOVE_FROM_UNPROTECTED_ORIGINS,
62 REMOVE_FROM_ALL_ORIGINS
63 };
64
60 // Mask used for Remove. 65 // Mask used for Remove.
61 enum RemoveDataMask { 66 enum RemoveDataMask {
62 REMOVE_APPCACHE = 1 << 0, 67 REMOVE_APPCACHE = 1 << 0,
63 REMOVE_CACHE = 1 << 1, 68 REMOVE_CACHE = 1 << 1,
64 REMOVE_COOKIES = 1 << 2, 69 REMOVE_COOKIES = 1 << 2,
65 REMOVE_DOWNLOADS = 1 << 3, 70 REMOVE_DOWNLOADS = 1 << 3,
66 REMOVE_FILE_SYSTEMS = 1 << 4, 71 REMOVE_FILE_SYSTEMS = 1 << 4,
67 REMOVE_FORM_DATA = 1 << 5, 72 REMOVE_FORM_DATA = 1 << 5,
68 // In addition to visits, REMOVE_HISTORY removes keywords and last session. 73 // In addition to visits, REMOVE_HISTORY removes keywords and last session.
69 REMOVE_HISTORY = 1 << 6, 74 REMOVE_HISTORY = 1 << 6,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // profile in the specified time range. Use Remove to initiate the removal. 118 // profile in the specified time range. Use Remove to initiate the removal.
114 BrowsingDataRemover(Profile* profile, base::Time delete_begin, 119 BrowsingDataRemover(Profile* profile, base::Time delete_begin,
115 base::Time delete_end); 120 base::Time delete_end);
116 121
117 // Creates a BrowsingDataRemover to remove browser data from the specified 122 // Creates a BrowsingDataRemover to remove browser data from the specified
118 // profile in the specified time range. 123 // profile in the specified time range.
119 BrowsingDataRemover(Profile* profile, TimePeriod time_period, 124 BrowsingDataRemover(Profile* profile, TimePeriod time_period,
120 base::Time delete_end); 125 base::Time delete_end);
121 126
122 // Removes the specified items related to browsing for all origins. 127 // Removes the specified items related to browsing for all origins.
123 void Remove(int remove_mask); 128 void Remove(int remove_mask, RemoveOriginSet origin_set);
Bernhard Bauer 2012/05/23 11:13:11 Is there a reason you're not just passing in a boo
Mike West 2012/05/23 11:23:51 Magic booleans are confusing in a public API. *shr
Bernhard Bauer 2012/05/23 11:31:40 Right; what I usually do in that case is something
124 129
125 void AddObserver(Observer* observer); 130 void AddObserver(Observer* observer);
126 void RemoveObserver(Observer* observer); 131 void RemoveObserver(Observer* observer);
127 132
128 // Called when history deletion is done. 133 // Called when history deletion is done.
129 void OnHistoryDeletionDone(); 134 void OnHistoryDeletionDone();
130 135
131 // Quota managed data uses a different bitmask for types than 136 // Quota managed data uses a different bitmask for types than
132 // BrowsingDataRemover uses. This method generates that mask. 137 // BrowsingDataRemover uses. This method generates that mask.
133 static int GenerateQuotaClientMask(int remove_mask); 138 static int GenerateQuotaClientMask(int remove_mask);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 325
321 ObserverList<Observer> observer_list_; 326 ObserverList<Observer> observer_list_;
322 327
323 // Used if we need to clear history. 328 // Used if we need to clear history.
324 CancelableRequestConsumer request_consumer_; 329 CancelableRequestConsumer request_consumer_;
325 330
326 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); 331 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover);
327 }; 332 };
328 333
329 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ 334 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698