Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_counter_factory.cc

Issue 2816723002: Add "Site Settings" option to Clear Browsing Data on Android (Closed)
Patch Set: fix comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/browsing_data/cache_counter.h" 11 #include "chrome/browser/browsing_data/cache_counter.h"
12 #include "chrome/browser/browsing_data/downloads_counter.h" 12 #include "chrome/browser/browsing_data/downloads_counter.h"
13 #include "chrome/browser/browsing_data/media_licenses_counter.h" 13 #include "chrome/browser/browsing_data/media_licenses_counter.h"
14 #include "chrome/browser/browsing_data/site_data_counter.h" 14 #include "chrome/browser/browsing_data/site_data_counter.h"
15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
15 #include "chrome/browser/history/history_service_factory.h" 16 #include "chrome/browser/history/history_service_factory.h"
16 #include "chrome/browser/history/web_history_service_factory.h" 17 #include "chrome/browser/history/web_history_service_factory.h"
17 #include "chrome/browser/password_manager/password_store_factory.h" 18 #include "chrome/browser/password_manager/password_store_factory.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/sync/profile_sync_service_factory.h" 20 #include "chrome/browser/sync/profile_sync_service_factory.h"
20 #include "chrome/browser/web_data_service_factory.h" 21 #include "chrome/browser/web_data_service_factory.h"
21 #include "components/browser_sync/profile_sync_service.h" 22 #include "components/browser_sync/profile_sync_service.h"
22 #include "components/browsing_data/core/counters/autofill_counter.h" 23 #include "components/browsing_data/core/counters/autofill_counter.h"
23 #include "components/browsing_data/core/counters/browsing_data_counter.h" 24 #include "components/browsing_data/core/counters/browsing_data_counter.h"
24 #include "components/browsing_data/core/counters/history_counter.h" 25 #include "components/browsing_data/core/counters/history_counter.h"
25 #include "components/browsing_data/core/counters/passwords_counter.h" 26 #include "components/browsing_data/core/counters/passwords_counter.h"
27 #include "components/browsing_data/core/counters/site_settings_counter.h"
26 #include "components/browsing_data/core/pref_names.h" 28 #include "components/browsing_data/core/pref_names.h"
27 #include "components/history/core/browser/web_history_service.h" 29 #include "components/history/core/browser/web_history_service.h"
28 #include "components/password_manager/core/browser/password_store.h" 30 #include "components/password_manager/core/browser/password_store.h"
29 #include "extensions/features/features.h" 31 #include "extensions/features/features.h"
30 32
31 #if BUILDFLAG(ENABLE_EXTENSIONS) 33 #if BUILDFLAG(ENABLE_EXTENSIONS)
32 #include "chrome/browser/browsing_data/hosted_apps_counter.h" 34 #include "chrome/browser/browsing_data/hosted_apps_counter.h"
33 #endif 35 #endif
34 36
35 namespace { 37 namespace {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 WebDataServiceFactory::GetAutofillWebDataForProfile( 88 WebDataServiceFactory::GetAutofillWebDataForProfile(
87 profile, ServiceAccessType::EXPLICIT_ACCESS)); 89 profile, ServiceAccessType::EXPLICIT_ACCESS));
88 } 90 }
89 91
90 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) 92 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory)
91 return base::MakeUnique<DownloadsCounter>(profile); 93 return base::MakeUnique<DownloadsCounter>(profile);
92 94
93 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) 95 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses)
94 return base::MakeUnique<MediaLicensesCounter>(profile); 96 return base::MakeUnique<MediaLicensesCounter>(profile);
95 97
98 if (pref_name == browsing_data::prefs::kDeleteSiteSettings)
99 return base::MakeUnique<browsing_data::SiteSettingsCounter>(
Bernhard Bauer 2017/05/03 14:29:21 Nit: If the body of an if-statement is more than o
dullweber 2017/05/03 15:59:13 Done.
100 HostContentSettingsMapFactory::GetForProfile(profile));
101
96 #if BUILDFLAG(ENABLE_EXTENSIONS) 102 #if BUILDFLAG(ENABLE_EXTENSIONS)
97 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) 103 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData)
98 return base::MakeUnique<HostedAppsCounter>(profile); 104 return base::MakeUnique<HostedAppsCounter>(profile);
99 #endif 105 #endif
100 106
101 return nullptr; 107 return nullptr;
102 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698