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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/browsing_data/core/browsing_data_utils.h" 5 #include "components/browsing_data/core/browsing_data_utils.h"
6 6
7 #include "components/browsing_data/core/counters/autofill_counter.h" 7 #include "components/browsing_data/core/counters/autofill_counter.h"
8 #include "components/browsing_data/core/counters/history_counter.h" 8 #include "components/browsing_data/core/counters/history_counter.h"
9 #include "components/browsing_data/core/counters/passwords_counter.h" 9 #include "components/browsing_data/core/counters/passwords_counter.h"
10 #include "components/browsing_data/core/pref_names.h" 10 #include "components/browsing_data/core/pref_names.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 displayed_strings[1], displayed_strings[2]); 134 displayed_strings[1], displayed_strings[2]);
135 break; 135 break;
136 default: 136 default:
137 NOTREACHED(); 137 NOTREACHED();
138 } 138 }
139 } 139 }
140 140
141 return text; 141 return text;
142 } 142 }
143 143
144 bool GetDeletionPreferenceFromDataType(
145 BrowsingDataType data_type,
146 std::string* out_pref) {
147 switch (data_type) {
148 case HISTORY:
149 *out_pref = prefs::kDeleteBrowsingHistory;
150 return true;
151 case CACHE:
152 *out_pref = prefs::kDeleteCache;
153 return true;
154 case COOKIES:
155 *out_pref = prefs::kDeleteCookies;
156 return true;
157 case PASSWORDS:
158 *out_pref = prefs::kDeletePasswords;
159 return true;
160 case FORM_DATA:
161 *out_pref = prefs::kDeleteFormData;
162 return true;
163 case BOOKMARKS:
164 // Bookmarks are deleted on the Android side. No corresponding deletion
165 // preference.
166 return false;
167 case NUM_TYPES:
168 // This is not an actual type.
169 NOTREACHED();
170 return false;
171 }
172 NOTREACHED();
173 return false;
174 }
175
144 } // namespace browsing_data 176 } // namespace browsing_data
OLDNEW
« 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