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

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 deps 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 profile, ServiceAccessType::EXPLICIT_ACCESS), 89 profile, ServiceAccessType::EXPLICIT_ACCESS),
88 ProfileSyncServiceFactory::GetForProfile(profile)); 90 ProfileSyncServiceFactory::GetForProfile(profile));
89 } 91 }
90 92
91 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) 93 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory)
92 return base::MakeUnique<DownloadsCounter>(profile); 94 return base::MakeUnique<DownloadsCounter>(profile);
93 95
94 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) 96 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses)
95 return base::MakeUnique<MediaLicensesCounter>(profile); 97 return base::MakeUnique<MediaLicensesCounter>(profile);
96 98
99 if (pref_name == browsing_data::prefs::kDeleteSiteSettings) {
100 return base::MakeUnique<browsing_data::SiteSettingsCounter>(
101 HostContentSettingsMapFactory::GetForProfile(profile));
102 }
103
97 #if BUILDFLAG(ENABLE_EXTENSIONS) 104 #if BUILDFLAG(ENABLE_EXTENSIONS)
98 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) 105 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData)
99 return base::MakeUnique<HostedAppsCounter>(profile); 106 return base::MakeUnique<HostedAppsCounter>(profile);
100 #endif 107 #endif
101 108
102 return nullptr; 109 return nullptr;
103 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698