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

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: Add comments for issues with incomplete data deletion Created 3 years, 11 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/cookie_counter.h"
12 #include "chrome/browser/browsing_data/downloads_counter.h" 13 #include "chrome/browser/browsing_data/downloads_counter.h"
13 #include "chrome/browser/browsing_data/media_licenses_counter.h" 14 #include "chrome/browser/browsing_data/media_licenses_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"
(...skipping 29 matching lines...) Expand all
51 HistoryServiceFactory::GetForProfile( 52 HistoryServiceFactory::GetForProfile(
52 profile, ServiceAccessType::EXPLICIT_ACCESS), 53 profile, ServiceAccessType::EXPLICIT_ACCESS),
53 base::Bind(&GetUpdatedWebHistoryService, 54 base::Bind(&GetUpdatedWebHistoryService,
54 base::Unretained(profile)), 55 base::Unretained(profile)),
55 ProfileSyncServiceFactory::GetForProfile(profile)); 56 ProfileSyncServiceFactory::GetForProfile(profile));
56 } 57 }
57 58
58 if (pref_name == browsing_data::prefs::kDeleteCache) 59 if (pref_name == browsing_data::prefs::kDeleteCache)
59 return base::MakeUnique<CacheCounter>(profile); 60 return base::MakeUnique<CacheCounter>(profile);
60 61
62 if (pref_name == browsing_data::prefs::kDeleteCookies)
63 return base::MakeUnique<CookieCounter>(profile);
64
61 if (pref_name == browsing_data::prefs::kDeletePasswords) { 65 if (pref_name == browsing_data::prefs::kDeletePasswords) {
62 return base::MakeUnique<browsing_data::PasswordsCounter>( 66 return base::MakeUnique<browsing_data::PasswordsCounter>(
63 PasswordStoreFactory::GetForProfile( 67 PasswordStoreFactory::GetForProfile(
64 profile, ServiceAccessType::EXPLICIT_ACCESS)); 68 profile, ServiceAccessType::EXPLICIT_ACCESS));
65 } 69 }
66 70
67 if (pref_name == browsing_data::prefs::kDeleteFormData) { 71 if (pref_name == browsing_data::prefs::kDeleteFormData) {
68 return base::MakeUnique<browsing_data::AutofillCounter>( 72 return base::MakeUnique<browsing_data::AutofillCounter>(
69 WebDataServiceFactory::GetAutofillWebDataForProfile( 73 WebDataServiceFactory::GetAutofillWebDataForProfile(
70 profile, ServiceAccessType::EXPLICIT_ACCESS)); 74 profile, ServiceAccessType::EXPLICIT_ACCESS));
71 } 75 }
72 76
73 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory) 77 if (pref_name == browsing_data::prefs::kDeleteDownloadHistory)
74 return base::MakeUnique<DownloadsCounter>(profile); 78 return base::MakeUnique<DownloadsCounter>(profile);
75 79
76 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) 80 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses)
77 return base::MakeUnique<MediaLicensesCounter>(profile); 81 return base::MakeUnique<MediaLicensesCounter>(profile);
78 82
79 #if BUILDFLAG(ENABLE_EXTENSIONS) 83 #if BUILDFLAG(ENABLE_EXTENSIONS)
80 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData) 84 if (pref_name == browsing_data::prefs::kDeleteHostedAppsData)
81 return base::MakeUnique<HostedAppsCounter>(profile); 85 return base::MakeUnique<HostedAppsCounter>(profile);
82 #endif 86 #endif
83 87
84 return nullptr; 88 return nullptr;
85 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698