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

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

Issue 1530123002: Prepare ClearBrowsingDataDialogFragment for browsing data counters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@utils
Patch Set: Added *Bridge class, shared enum Created 4 years, 11 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 21a328a05e1ac805a6733cdf275def2badff22fe..00d3f2b8f16264a2bd6d9cae911cf2d158be6225 100644
--- a/chrome/browser/browsing_data/browsing_data_counter_utils.cc
+++ b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
@@ -168,6 +168,34 @@ base::string16 GetCounterTextFromResult(
return text;
}
+bool GetDeletionPreferenceFromDataType(
+ ClankBrowsingDataType data_type, std::string* out_pref) {
+ switch (data_type) {
+ case HISTORY:
+ *out_pref = prefs::kDeleteBrowsingHistory;
+ return true;
+ case CACHE:
+ *out_pref = prefs::kDeleteCache;
+ return true;
+ case COOKIES:
+ *out_pref = prefs::kDeleteCookies;
+ return true;
+ case PASSWORDS:
+ *out_pref = prefs::kDeletePasswords;
+ return true;
+ case FORM_DATA:
+ *out_pref = prefs::kDeleteFormData;
+ return true;
+ case BOOKMARKS:
+ // Bookmarks are deleted on the Android side. No corresponding deletion
+ // preference.
+ return false;
+ default:
+ NOTREACHED();
+ return false;
+ }
+}
+
BrowsingDataCounter* CreateCounterForPreference(std::string pref_name) {
if (!AreCountersEnabled())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698