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/prefs/pref_service.h" | |
9 #include "chrome/browser/browsing_data/autofill_counter.h" | 8 #include "chrome/browser/browsing_data/autofill_counter.h" |
10 #include "chrome/browser/browsing_data/cache_counter.h" | 9 #include "chrome/browser/browsing_data/cache_counter.h" |
11 #include "chrome/browser/browsing_data/history_counter.h" | 10 #include "chrome/browser/browsing_data/history_counter.h" |
12 #include "chrome/browser/browsing_data/passwords_counter.h" | 11 #include "chrome/browser/browsing_data/passwords_counter.h" |
13 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
15 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
| 15 #include "components/prefs/pref_service.h" |
16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/base/text/bytes_formatting.h" | 17 #include "ui/base/text/bytes_formatting.h" |
18 | 18 |
19 bool AreCountersEnabled() { | 19 bool AreCountersEnabled() { |
20 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 20 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
21 switches::kEnableClearBrowsingDataCounters)) { | 21 switches::kEnableClearBrowsingDataCounters)) { |
22 return true; | 22 return true; |
23 } | 23 } |
24 | 24 |
25 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 25 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return new HistoryCounter(); | 207 return new HistoryCounter(); |
208 if (pref_name == prefs::kDeleteCache) | 208 if (pref_name == prefs::kDeleteCache) |
209 return new CacheCounter(); | 209 return new CacheCounter(); |
210 if (pref_name == prefs::kDeletePasswords) | 210 if (pref_name == prefs::kDeletePasswords) |
211 return new PasswordsCounter(); | 211 return new PasswordsCounter(); |
212 if (pref_name == prefs::kDeleteFormData) | 212 if (pref_name == prefs::kDeleteFormData) |
213 return new AutofillCounter(); | 213 return new AutofillCounter(); |
214 | 214 |
215 return nullptr; | 215 return nullptr; |
216 } | 216 } |
OLD | NEW |