Index: components/browsing_data/core/counters/browsing_data_counter.cc |
diff --git a/components/browsing_data/core/counters/browsing_data_counter.cc b/components/browsing_data/core/counters/browsing_data_counter.cc |
index ec67193687bca28fc26a48e1a64ae508680f2fe6..8280472b5d4ac08922cc8bb1147d11a892f1c488 100644 |
--- a/components/browsing_data/core/counters/browsing_data_counter.cc |
+++ b/components/browsing_data/core/counters/browsing_data_counter.cc |
@@ -18,14 +18,15 @@ BrowsingDataCounter::BrowsingDataCounter() {} |
BrowsingDataCounter::~BrowsingDataCounter() {} |
void BrowsingDataCounter::Init(PrefService* pref_service, |
+ ClearBrowsingDataPreferenceType pref_type, |
const Callback& callback) { |
DCHECK(!initialized_); |
callback_ = callback; |
- pref_service_ = pref_service; |
- pref_.Init(GetPrefName(), pref_service_, |
+ pref_type_ = pref_type; |
+ pref_.Init(GetPrefName(), pref_service, |
base::Bind(&BrowsingDataCounter::Restart, base::Unretained(this))); |
period_.Init( |
- browsing_data::prefs::kDeleteTimePeriod, pref_service_, |
+ GetTimePeriodPrefName(), pref_service, |
base::Bind(&BrowsingDataCounter::Restart, base::Unretained(this))); |
initialized_ = true; |
@@ -54,8 +55,14 @@ void BrowsingDataCounter::ReportResult(std::unique_ptr<Result> result) { |
callback_.Run(std::move(result)); |
} |
-PrefService* BrowsingDataCounter::GetPrefs() const { |
- return pref_service_; |
+const char* BrowsingDataCounter::GetTimePeriodPrefName() const { |
+ return GetPrefType() == ClearBrowsingDataPreferenceType::BASIC |
msramek
2017/02/08 10:55:56
This is already defined as browsing_data::GetTimeP
dullweber
2017/02/08 23:03:19
Thanks, I removed this method.
|
+ ? browsing_data::prefs::kDeleteTimePeriodBasic |
+ : browsing_data::prefs::kDeleteTimePeriod; |
+} |
+ |
+ClearBrowsingDataPreferenceType BrowsingDataCounter::GetPrefType() const { |
+ return pref_type_; |
} |
// BrowsingDataCounter::Result ------------------------------------------------- |