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

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: isOptionSelectedByDefault 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..58e191621112f76b605f6cd1c3e3403c65e977d3 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(
+ BrowsingDataType 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:
Bernhard Bauer 2016/01/14 16:12:43 Replace this with NUM_TYPES please, so that the co
msramek 2016/01/14 18:03:33 Done. Unfortunately, since |data_type| can possibl
Bernhard Bauer 2016/01/14 18:23:00 Yes, but that's what NOTREACHED() is for. :) (I t
msramek 2016/01/14 18:37:58 It came to my mind, but I decided for a separate N
+ NOTREACHED();
+ return false;
+ }
+}
+
BrowsingDataCounter* CreateCounterForPreference(std::string pref_name) {
if (!AreCountersEnabled())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698