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

Unified Diff: chrome/browser/browsing_data/browsing_data_counter_utils.cc

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed deps Created 4 years, 6 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: chrome/browser/browsing_data/browsing_data_counter_utils.cc
diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils.cc b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
index 39c3a9b6c72644aea0b4c3705a35e86ae6bfe70b..ce68f93d3cc8badfcb7fdf99b25efcf8554583c1 100644
--- a/chrome/browser/browsing_data/browsing_data_counter_utils.cc
+++ b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
@@ -72,20 +72,19 @@ base::string16 GetCounterTextFromResult(
static_cast<const BrowsingDataCounter::FinishedResult*>(
result)->Value();
- PrefService* prefs = result->source()->GetProfile()->GetPrefs();
- BrowsingDataRemover::TimePeriod time_period =
- static_cast<BrowsingDataRemover::TimePeriod>(
- prefs->GetInteger(prefs::kDeleteTimePeriod));
+ PrefService* prefs = result->source()->GetPrefs();
+ TimePeriod time_period =
+ static_cast<TimePeriod>(prefs->GetInteger(prefs::kDeleteTimePeriod));
// Three cases: Nonzero result for the entire cache, nonzero result for
// a subset of cache (i.e. a finite time interval), and almost zero (< 1MB).
static const int kBytesInAMegabyte = 1024 * 1024;
if (cache_size_bytes >= kBytesInAMegabyte) {
base::string16 formatted_size = FormatBytesMBOrHigher(cache_size_bytes);
- text = time_period == BrowsingDataRemover::EVERYTHING
- ? formatted_size
- : l10n_util::GetStringFUTF16(IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE,
- formatted_size);
+ text = time_period == EVERYTHING
+ ? formatted_size
+ : l10n_util::GetStringFUTF16(
+ IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE, formatted_size);
} else {
text = l10n_util::GetStringUTF16(IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY);
}
@@ -238,18 +237,19 @@ bool GetDeletionPreferenceFromDataType(
return false;
}
-BrowsingDataCounter* CreateCounterForPreference(std::string pref_name) {
+BrowsingDataCounter* CreateCounterForPreference(std::string pref_name,
+ Profile* profile) {
if (!AreCountersEnabled())
return nullptr;
if (pref_name == prefs::kDeleteBrowsingHistory)
- return new HistoryCounter();
+ return new HistoryCounter(profile);
if (pref_name == prefs::kDeleteCache)
- return new CacheCounter();
+ return new CacheCounter(profile);
if (pref_name == prefs::kDeletePasswords)
- return new PasswordsCounter();
+ return new PasswordsCounter(profile);
if (pref_name == prefs::kDeleteFormData)
- return new AutofillCounter();
+ return new AutofillCounter(profile);
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698