| OLD | NEW |
| 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 "chrome/browser/browsing_data/browsing_data_counter_factory.h" | 5 #include "chrome/browser/browsing_data/browsing_data_counter_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" | 10 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 IsSiteDataCounterEnabled()) { | 69 IsSiteDataCounterEnabled()) { |
| 70 return base::MakeUnique<SiteDataCounter>(profile); | 70 return base::MakeUnique<SiteDataCounter>(profile); |
| 71 } | 71 } |
| 72 if (pref_name == browsing_data::prefs::kDeleteCookiesBasic) { | 72 if (pref_name == browsing_data::prefs::kDeleteCookiesBasic) { |
| 73 // The cookies option on the basic tab doesn't use a counter. | 73 // The cookies option on the basic tab doesn't use a counter. |
| 74 return nullptr; | 74 return nullptr; |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (pref_name == browsing_data::prefs::kDeletePasswords) { | 77 if (pref_name == browsing_data::prefs::kDeletePasswords) { |
| 78 return base::MakeUnique<browsing_data::PasswordsCounter>( | 78 return base::MakeUnique<browsing_data::PasswordsCounter>( |
| 79 PasswordStoreFactory::GetForProfile( | 79 PasswordStoreFactory::GetForProfile(profile, |
| 80 profile, ServiceAccessType::EXPLICIT_ACCESS)); | 80 ServiceAccessType::EXPLICIT_ACCESS), |
| 81 ProfileSyncServiceFactory::GetForProfile(profile)); |
| 81 } | 82 } |
| 82 | 83 |
| 83 if (pref_name == browsing_data::prefs::kDeleteFormData) { | 84 if (pref_name == browsing_data::prefs::kDeleteFormData) { |
| 84 return base::MakeUnique<browsing_data::AutofillCounter>( | 85 return base::MakeUnique<browsing_data::AutofillCounter>( |
| 85 WebDataServiceFactory::GetAutofillWebDataForProfile( | 86 WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 86 profile, ServiceAccessType::EXPLICIT_ACCESS)); | 87 profile, ServiceAccessType::EXPLICIT_ACCESS)); |
| 87 } | 88 } |
| 88 | 89 |
| 89 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) | 90 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) |
| 90 return base::MakeUnique<DownloadsCounter>(profile); | 91 return base::MakeUnique<DownloadsCounter>(profile); |
| 91 | 92 |
| 92 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) | 93 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) |
| 93 return base::MakeUnique<MediaLicensesCounter>(profile); | 94 return base::MakeUnique<MediaLicensesCounter>(profile); |
| 94 | 95 |
| 95 #if BUILDFLAG(ENABLE_EXTENSIONS) | 96 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 96 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) | 97 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) |
| 97 return base::MakeUnique<HostedAppsCounter>(profile); | 98 return base::MakeUnique<HostedAppsCounter>(profile); |
| 98 #endif | 99 #endif |
| 99 | 100 |
| 100 return nullptr; | 101 return nullptr; |
| 101 } | 102 } |
| OLD | NEW |