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

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

Issue 2594723002: Count number of origins with data affected by clearing "cookies and site data". (Closed)
Patch Set: improve string description Created 3 years, 9 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/history/history_service_factory.h" 15 #include "chrome/browser/history/history_service_factory.h"
15 #include "chrome/browser/history/web_history_service_factory.h" 16 #include "chrome/browser/history/web_history_service_factory.h"
16 #include "chrome/browser/password_manager/password_store_factory.h" 17 #include "chrome/browser/password_manager/password_store_factory.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/sync/profile_sync_service_factory.h" 19 #include "chrome/browser/sync/profile_sync_service_factory.h"
19 #include "chrome/browser/web_data_service_factory.h" 20 #include "chrome/browser/web_data_service_factory.h"
20 #include "components/browser_sync/profile_sync_service.h" 21 #include "components/browser_sync/profile_sync_service.h"
21 #include "components/browsing_data/core/counters/autofill_counter.h" 22 #include "components/browsing_data/core/counters/autofill_counter.h"
22 #include "components/browsing_data/core/counters/browsing_data_counter.h" 23 #include "components/browsing_data/core/counters/browsing_data_counter.h"
23 #include "components/browsing_data/core/counters/history_counter.h" 24 #include "components/browsing_data/core/counters/history_counter.h"
(...skipping 29 matching lines...) Expand all
53 profile, ServiceAccessType::EXPLICIT_ACCESS), 54 profile, ServiceAccessType::EXPLICIT_ACCESS),
54 base::Bind(&GetUpdatedWebHistoryService, 55 base::Bind(&GetUpdatedWebHistoryService,
55 base::Unretained(profile)), 56 base::Unretained(profile)),
56 ProfileSyncServiceFactory::GetForProfile(profile)); 57 ProfileSyncServiceFactory::GetForProfile(profile));
57 } 58 }
58 59
59 if (pref_name == browsing_data::prefs::kDeleteCache || 60 if (pref_name == browsing_data::prefs::kDeleteCache ||
60 pref_name == browsing_data::prefs::kDeleteCacheBasic) 61 pref_name == browsing_data::prefs::kDeleteCacheBasic)
61 return base::MakeUnique<CacheCounter>(profile); 62 return base::MakeUnique<CacheCounter>(profile);
62 63
64 if (pref_name == browsing_data::prefs::kDeleteCookies &&
65 IsCookieCounterEnabled())
66 return base::MakeUnique<SiteDataCounter>(profile);
msramek 2017/03/06 09:40:57 style: braces if the "if" statement takes more tha
dullweber 2017/03/06 10:44:53 Done.
67
63 if (pref_name == browsing_data::prefs::kDeletePasswords) { 68 if (pref_name == browsing_data::prefs::kDeletePasswords) {
64 return base::MakeUnique<browsing_data::PasswordsCounter>( 69 return base::MakeUnique<browsing_data::PasswordsCounter>(
65 PasswordStoreFactory::GetForProfile( 70 PasswordStoreFactory::GetForProfile(
66 profile, ServiceAccessType::EXPLICIT_ACCESS)); 71 profile, ServiceAccessType::EXPLICIT_ACCESS));
67 } 72 }
68 73
69 if (pref_name == browsing_data::prefs::kDeleteFormData) { 74 if (pref_name == browsing_data::prefs::kDeleteFormData) {
70 return base::MakeUnique<browsing_data::AutofillCounter>( 75 return base::MakeUnique<browsing_data::AutofillCounter>(
71 WebDataServiceFactory::GetAutofillWebDataForProfile( 76 WebDataServiceFactory::GetAutofillWebDataForProfile(
72 profile, ServiceAccessType::EXPLICIT_ACCESS)); 77 profile, ServiceAccessType::EXPLICIT_ACCESS));
73 } 78 }
74 79
75 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) 80 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory)
76 return base::MakeUnique<DownloadsCounter>(profile); 81 return base::MakeUnique<DownloadsCounter>(profile);
77 82
78 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) 83 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses)
79 return base::MakeUnique<MediaLicensesCounter>(profile); 84 return base::MakeUnique<MediaLicensesCounter>(profile);
80 85
81 #if BUILDFLAG(ENABLE_EXTENSIONS) 86 #if BUILDFLAG(ENABLE_EXTENSIONS)
82 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) 87 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData)
83 return base::MakeUnique<HostedAppsCounter>(profile); 88 return base::MakeUnique<HostedAppsCounter>(profile);
84 #endif 89 #endif
85 90
86 return nullptr; 91 return nullptr;
87 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698