OLD | NEW |
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/autofill_counter.h" | 9 #include "chrome/browser/browsing_data/autofill_counter.h" |
10 #include "chrome/browser/browsing_data/cache_counter.h" | 10 #include "chrome/browser/browsing_data/cache_counter.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // preference. | 254 // preference. |
255 return false; | 255 return false; |
256 case browsing_data::NUM_TYPES: | 256 case browsing_data::NUM_TYPES: |
257 // This is not an actual type. | 257 // This is not an actual type. |
258 NOTREACHED(); | 258 NOTREACHED(); |
259 return false; | 259 return false; |
260 } | 260 } |
261 NOTREACHED(); | 261 NOTREACHED(); |
262 return false; | 262 return false; |
263 } | 263 } |
264 | |
265 browsing_data::BrowsingDataCounter* CreateCounterForPreference( | |
266 std::string pref_name, | |
267 Profile* profile) { | |
268 if (!AreCountersEnabled()) | |
269 return nullptr; | |
270 | |
271 if (pref_name == prefs::kDeleteBrowsingHistory) | |
272 return new HistoryCounter(profile); | |
273 if (pref_name == prefs::kDeleteCache) | |
274 return new CacheCounter(profile); | |
275 if (pref_name == prefs::kDeletePasswords) | |
276 return new PasswordsCounter(profile); | |
277 if (pref_name == prefs::kDeleteFormData) | |
278 return new AutofillCounter(profile); | |
279 | |
280 return nullptr; | |
281 } | |
OLD | NEW |