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

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: s/default/NUM_TYPES/ 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
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_counter_utils.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5acb28e16ebb59fce659431bba0a282e3e90e2ff 100644
--- a/chrome/browser/browsing_data/browsing_data_counter_utils.cc
+++ b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
@@ -168,6 +168,37 @@ 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;
+ case NUM_TYPES:
+ // This is not an actual type.
+ NOTREACHED();
+ return false;
+ }
+ NOTREACHED();
+ return false;
+}
+
BrowsingDataCounter* CreateCounterForPreference(std::string pref_name) {
if (!AreCountersEnabled())
return nullptr;
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_counter_utils.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698