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" | 8 #include "base/prefs/pref_service.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" |
11 #include "chrome/browser/browsing_data/history_counter.h" | 11 #include "chrome/browser/browsing_data/history_counter.h" |
12 #include "chrome/browser/browsing_data/passwords_counter.h" | 12 #include "chrome/browser/browsing_data/passwords_counter.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.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 namespace browsing_data_counter_utils { |
| 20 |
19 bool AreCountersEnabled() { | 21 bool AreCountersEnabled() { |
20 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 22 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
21 switches::kEnableClearBrowsingDataCounters)) { | 23 switches::kEnableClearBrowsingDataCounters)) { |
22 return true; | 24 return true; |
23 } | 25 } |
24 | 26 |
25 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 27 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
26 switches::kDisableClearBrowsingDataCounters)) { | 28 switches::kDisableClearBrowsingDataCounters)) { |
27 return false; | 29 return false; |
28 } | 30 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return new HistoryCounter(); | 206 return new HistoryCounter(); |
205 if (pref_name == prefs::kDeleteCache) | 207 if (pref_name == prefs::kDeleteCache) |
206 return new CacheCounter(); | 208 return new CacheCounter(); |
207 if (pref_name == prefs::kDeletePasswords) | 209 if (pref_name == prefs::kDeletePasswords) |
208 return new PasswordsCounter(); | 210 return new PasswordsCounter(); |
209 if (pref_name == prefs::kDeleteFormData) | 211 if (pref_name == prefs::kDeleteFormData) |
210 return new AutofillCounter(); | 212 return new AutofillCounter(); |
211 | 213 |
212 return nullptr; | 214 return nullptr; |
213 } | 215 } |
| 216 |
| 217 } // namespace browsing_data_counter_utils |
OLD | NEW |