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; |