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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_counter_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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" 5 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browsing_data/cache_counter.h" 9 #include "chrome/browser/browsing_data/cache_counter.h"
10 #include "chrome/browser/browsing_data/media_licenses_counter.h" 10 #include "chrome/browser/browsing_data/media_licenses_counter.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return base::ReplaceStringPlaceholders( 130 return base::ReplaceStringPlaceholders(
131 l10n_util::GetPluralStringFUTF16( 131 l10n_util::GetPluralStringFUTF16(
132 IDS_DEL_HOSTED_APPS_COUNTER, hosted_apps_count), 132 IDS_DEL_HOSTED_APPS_COUNTER, hosted_apps_count),
133 replacements, 133 replacements,
134 nullptr); 134 nullptr);
135 } 135 }
136 #endif 136 #endif
137 137
138 return browsing_data::GetCounterTextFromResult(result); 138 return browsing_data::GetCounterTextFromResult(result);
139 } 139 }
140
141 bool GetDeletionPreferenceFromDataType(
142 browsing_data::BrowsingDataType data_type,
143 std::string* out_pref) {
144 switch (data_type) {
145 case browsing_data::HISTORY:
146 *out_pref = browsing_data::prefs::kDeleteBrowsingHistory;
147 return true;
148 case browsing_data::CACHE:
149 *out_pref = browsing_data::prefs::kDeleteCache;
150 return true;
151 case browsing_data::COOKIES:
152 *out_pref = browsing_data::prefs::kDeleteCookies;
153 return true;
154 case browsing_data::PASSWORDS:
155 *out_pref = browsing_data::prefs::kDeletePasswords;
156 return true;
157 case browsing_data::FORM_DATA:
158 *out_pref = browsing_data::prefs::kDeleteFormData;
159 return true;
160 case browsing_data::BOOKMARKS:
161 // Bookmarks are deleted on the Android side. No corresponding deletion
162 // preference.
163 return false;
164 case browsing_data::NUM_TYPES:
165 // This is not an actual type.
166 NOTREACHED();
167 return false;
168 }
169 NOTREACHED();
170 return false;
171 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_counter_utils.h ('k') | components/browsing_data/core/browsing_data_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698