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

Unified Diff: components/browsing_data/core/browsing_data_utils.cc

Issue 2230243002: Move remaining clear browsing data util method to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_rest_of_counter_utils
Patch Set: Rebase Created 4 years, 4 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 | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browsing_data/core/browsing_data_utils.cc
diff --git a/components/browsing_data/core/browsing_data_utils.cc b/components/browsing_data/core/browsing_data_utils.cc
index a64f02b391db109c1090f51bf8fc799e38dffef8..b5b472bc19c6eb19ae28b2649e40d3f73168762d 100644
--- a/components/browsing_data/core/browsing_data_utils.cc
+++ b/components/browsing_data/core/browsing_data_utils.cc
@@ -141,4 +141,36 @@ 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;
+}
+
} // namespace browsing_data
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698