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

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

Issue 10898002: Refactor BrowsingDataRemover creation for clarity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BROWSING_DATA_REMOVER_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // Observer is notified when the removal is done. Done means keywords have 109 // Observer is notified when the removal is done. Done means keywords have
110 // been deleted, cache cleared and all other tasks scheduled. 110 // been deleted, cache cleared and all other tasks scheduled.
111 class Observer { 111 class Observer {
112 public: 112 public:
113 virtual void OnBrowsingDataRemoverDone() = 0; 113 virtual void OnBrowsingDataRemoverDone() = 0;
114 114
115 protected: 115 protected:
116 virtual ~Observer() {} 116 virtual ~Observer() {}
117 }; 117 };
118 118
119 static BrowsingDataRemover* create(Profile* profile,
markusheintz_ 2012/08/28 10:35:50 Method names should start with capital letters. s/
120 base::Time delete_begin = base::Time(),
markusheintz_ 2012/08/28 10:35:50 I think default values for parameters are discoura
121 base::Time delete_end = base::Time::Max());
122 static BrowsingDataRemover* create(Profile* profile,
123 TimePeriod deletionPeriod,
124 base::Time delete_end = base::Time::Max());
125
119 // Creates a BrowsingDataRemover to remove browser data from the specified 126 // Creates a BrowsingDataRemover to remove browser data from the specified
120 // profile in the specified time range. Use Remove to initiate the removal. 127 // profile in the specified time range. Use Remove to initiate the removal.
121 BrowsingDataRemover(Profile* profile, base::Time delete_begin, 128 BrowsingDataRemover(Profile* profile, base::Time delete_begin,
markusheintz_ 2012/08/28 10:35:50 I think you may want to make this constructor priv
122 base::Time delete_end); 129 base::Time delete_end);
123 130
124 // Creates a BrowsingDataRemover to remove browser data from the specified
125 // profile in the specified time range.
126 BrowsingDataRemover(Profile* profile, TimePeriod time_period,
127 base::Time delete_end);
128
129 // Removes the specified items related to browsing for all origins that match 131 // Removes the specified items related to browsing for all origins that match
130 // the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask). 132 // the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask).
131 void Remove(int remove_mask, int origin_set_mask); 133 void Remove(int remove_mask, int origin_set_mask);
132 134
133 void AddObserver(Observer* observer); 135 void AddObserver(Observer* observer);
134 void RemoveObserver(Observer* observer); 136 void RemoveObserver(Observer* observer);
135 137
136 // Called when history deletion is done. 138 // Called when history deletion is done.
137 void OnHistoryDeletionDone(); 139 void OnHistoryDeletionDone();
138 140
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 void OnClearedServerBoundCerts(); 282 void OnClearedServerBoundCerts();
281 283
282 // Callback on the DB thread so that we can wait for the form data to be 284 // Callback on the DB thread so that we can wait for the form data to be
283 // cleared. 285 // cleared.
284 void FormDataDBThreadHop(); 286 void FormDataDBThreadHop();
285 287
286 // Callback from the above method. 288 // Callback from the above method.
287 void OnClearedFormData(); 289 void OnClearedFormData();
288 290
289 // Calculate the begin time for the deletion range specified by |time_period|. 291 // Calculate the begin time for the deletion range specified by |time_period|.
290 base::Time CalculateBeginDeleteTime(TimePeriod time_period); 292 static base::Time CalculateBeginDeleteTime(TimePeriod time_period);
markusheintz_ 2012/08/28 10:35:50 After making this static, please order the methods
291 293
292 // Returns true if we're all done. 294 // Returns true if we're all done.
293 bool AllDone(); 295 bool AllDone();
294 296
295 // Setter for removing_; DCHECKs that we can only start removing if we're not 297 // Setter for removing_; DCHECKs that we can only start removing if we're not
296 // already removing, and vice-versa. 298 // already removing, and vice-versa.
297 static void set_removing(bool removing); 299 static void set_removing(bool removing);
298 300
299 content::NotificationRegistrar registrar_; 301 content::NotificationRegistrar registrar_;
300 302
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 368
367 ObserverList<Observer> observer_list_; 369 ObserverList<Observer> observer_list_;
368 370
369 // Used if we need to clear history. 371 // Used if we need to clear history.
370 CancelableRequestConsumer request_consumer_; 372 CancelableRequestConsumer request_consumer_;
371 373
372 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); 374 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover);
373 }; 375 };
374 376
375 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 377 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698