1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_COUNTER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_COUNTER_H_
10 #include "base/callback.h"
11 #include "base/prefs/pref_member.h"
12 #include "chrome/browser/profiles/profile.h"
14 class BrowsingDataCounter
{
16 typedef base::Callback
<void(bool, uint32
)> Callback
;
18 BrowsingDataCounter();
19 virtual ~BrowsingDataCounter();
21 // Should be called once to initialize this class.
22 void Init(Profile
* profile
,
23 const Callback
& callback
);
25 // Name of the preference associated with this counter.
26 virtual const std::string
& GetPrefName() const = 0;
29 // Should be called from |Count| by any overriding class to indicate that
30 // counting is finished and report the |result|.
31 void ReportResult(uint32 result
);
34 // Called when the boolean preference indicating whether this data type
35 // is to be deleted changes.
41 // The profile for which we will count the data volume.
44 // The callback that will be called when the UI should be updated with a new
48 // The boolean preference indicating whether this data type is to be deleted.
49 // If false, we will not count it.
50 BooleanPrefMember pref_
;
52 // Whether this counter is currently in the process of counting.
55 // Whether this class was properly initialized by calling |Init|.
59 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_COUNTER_H_