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

Unified Diff: components/browsing_data/core/counters/browsing_data_counter.h

Issue 2671743002: Separate state of basic and advanced tab in CBD dialog (Closed)
Patch Set: fix .classpath file Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/browsing_data/core/counters/browsing_data_counter.h
diff --git a/components/browsing_data/core/counters/browsing_data_counter.h b/components/browsing_data/core/counters/browsing_data_counter.h
index c2749364f539cabb9ae2e39b49f8650a696b11c9..53861d0a3d23b6cf8bce283f12b5070fcf4d00e0 100644
--- a/components/browsing_data/core/counters/browsing_data_counter.h
+++ b/components/browsing_data/core/counters/browsing_data_counter.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "components/browsing_data/core/browsing_data_enums.h"
#include "components/prefs/pref_member.h"
class PrefService;
@@ -62,14 +63,14 @@ class BrowsingDataCounter {
virtual ~BrowsingDataCounter();
// Should be called once to initialize this class.
- void Init(PrefService* pref_service, const Callback& callback);
+ void Init(PrefService* pref_service,
+ ClearBrowsingDataPreferenceType pref_type,
+ const Callback& callback);
// Name of the preference associated with this counter.
virtual const char* GetPrefName() const = 0;
- // PrefService that manages the preferences for the user profile
- // associated with this counter.
- PrefService* GetPrefs() const;
+ const char* GetTimePeriodPrefName() const;
// Restarts the counter. Will be called automatically if the counting needs
// to be restarted, e.g. when the deletion preference changes state or when
@@ -88,6 +89,10 @@ class BrowsingDataCounter {
// Calculates the beginning of the counting period as |period_| before now.
base::Time GetPeriodStart();
+ // Returns if this counter belongs to a preference on the default, basic or
+ // advanced CBD tab.
+ ClearBrowsingDataPreferenceType GetPrefType() const;
+
private:
// Called after the class is initialized by calling |Init|.
virtual void OnInitialized();
@@ -95,9 +100,8 @@ class BrowsingDataCounter {
// Count the data.
virtual void Count() = 0;
- // Pointer to the PrefService that manages the preferences for the user
- // profile associated with this counter.
- PrefService* pref_service_;
+ // Indicates if this counter belongs to a preference on the basic CBD tab.
+ ClearBrowsingDataPreferenceType pref_type_;
// The callback that will be called when the UI should be updated with a new
// counter value.

Powered by Google App Engine
This is Rietveld 408576698