| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 // static | 43 // static |
| 44 std::unique_ptr<browsing_data::BrowsingDataCounter> | 44 std::unique_ptr<browsing_data::BrowsingDataCounter> |
| 45 BrowsingDataCounterFactory::GetForProfileAndPref(Profile* profile, | 45 BrowsingDataCounterFactory::GetForProfileAndPref(Profile* profile, |
| 46 const std::string& pref_name) { | 46 const std::string& pref_name) { |
| 47 if (!AreCountersEnabled()) | 47 if (!AreCountersEnabled()) |
| 48 return nullptr; | 48 return nullptr; |
| 49 | 49 |
| 50 if (pref_name == browsing_data::prefs::kDeleteBrowsingHistory || | 50 if (pref_name == browsing_data::prefs::kDeleteBrowsingHistory) { |
| 51 pref_name == browsing_data::prefs::kDeleteBrowsingHistoryBasic) { | |
| 52 return base::MakeUnique<browsing_data::HistoryCounter>( | 51 return base::MakeUnique<browsing_data::HistoryCounter>( |
| 53 HistoryServiceFactory::GetForProfile( | 52 HistoryServiceFactory::GetForProfile( |
| 54 profile, ServiceAccessType::EXPLICIT_ACCESS), | 53 profile, ServiceAccessType::EXPLICIT_ACCESS), |
| 55 base::Bind(&GetUpdatedWebHistoryService, | 54 base::Bind(&GetUpdatedWebHistoryService, |
| 56 base::Unretained(profile)), | 55 base::Unretained(profile)), |
| 57 ProfileSyncServiceFactory::GetForProfile(profile)); | 56 ProfileSyncServiceFactory::GetForProfile(profile)); |
| 58 } | 57 } |
| 59 | 58 |
| 60 if (pref_name == browsing_data::prefs::kDeleteCache || | 59 if (pref_name == browsing_data::prefs::kDeleteCache || |
| 61 pref_name == browsing_data::prefs::kDeleteCacheBasic) { | 60 pref_name == browsing_data::prefs::kDeleteCacheBasic) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 85 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) | 84 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) |
| 86 return base::MakeUnique<MediaLicensesCounter>(profile); | 85 return base::MakeUnique<MediaLicensesCounter>(profile); |
| 87 | 86 |
| 88 #if BUILDFLAG(ENABLE_EXTENSIONS) | 87 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 89 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) | 88 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) |
| 90 return base::MakeUnique<HostedAppsCounter>(profile); | 89 return base::MakeUnique<HostedAppsCounter>(profile); |
| 91 #endif | 90 #endif |
| 92 | 91 |
| 93 return nullptr; | 92 return nullptr; |
| 94 } | 93 } |
| OLD | NEW |