OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/browsing_data/browsing_data_counter_factory.h" | |
6 | |
7 #include "chrome/browser/browsing_data/autofill_counter.h" | |
8 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" | |
9 #include "chrome/browser/browsing_data/cache_counter.h" | |
10 #include "chrome/browser/browsing_data/downloads_counter.h" | |
11 #include "chrome/browser/browsing_data/history_counter.h" | |
12 #include "chrome/browser/browsing_data/media_licenses_counter.h" | |
13 #include "chrome/browser/browsing_data/passwords_counter.h" | |
14 #include "chrome/browser/profiles/profile.h" | |
15 #include "chrome/common/pref_names.h" | |
16 #include "components/browsing_data/counters/browsing_data_counter.h" | |
17 | |
18 #if defined(ENABLE_EXTENSIONS) | |
19 #include "chrome/browser/browsing_data/hosted_apps_counter.h" | |
20 #endif | |
21 | |
22 // static | |
23 browsing_data::BrowsingDataCounter* | |
msramek
2016/07/07 11:55:32
We should return a unique_ptr<>, not a naked point
ioanap
2016/07/07 16:30:48
Done.
| |
24 BrowsingDataCounterFactory::GetForPreference(std::string pref_name, | |
25 Profile* profile) { | |
26 if (!AreCountersEnabled()) | |
27 return nullptr; | |
28 | |
29 if (pref_name == prefs::kDeleteBrowsingHistory) | |
30 return new HistoryCounter(profile); | |
31 if (pref_name == prefs::kDeleteCache) | |
32 return new CacheCounter(profile); | |
33 if (pref_name == prefs::kDeletePasswords) | |
34 return new PasswordsCounter(profile); | |
35 if (pref_name == prefs::kDeleteFormData) | |
36 return new AutofillCounter(profile); | |
37 if (pref_name == prefs::kDeleteDownloadHistory) | |
38 return new DownloadsCounter(profile); | |
39 if (pref_name == prefs::kDeleteMediaLicenses) | |
40 return new MediaLicensesCounter(profile); | |
41 #if defined(ENABLE_EXTENSIONS) | |
42 if (pref_name == prefs::kDeleteHostedAppsData) | |
43 return new HostedAppsCounter(profile); | |
44 #endif | |
45 | |
46 return nullptr; | |
47 } | |
OLD | NEW |