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

Unified Diff: chrome/browser/ui/webui/options/clear_browser_data_handler.cc

Issue 2121203002: Add BrowsingDataCounterFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_bd_counters_to_components
Patch Set: Fixed Android code and rebase Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/clear_browser_data_handler.cc
diff --git a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
index af97c6434ce66967e8a7354f6c61d0684e48b907..5fc3abe2631d50c032d80ad58bb1f78b09dd7fee 100644
--- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
+++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
@@ -22,6 +22,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/autofill_counter.h"
+#include "chrome/browser/browsing_data/browsing_data_counter_factory.h"
#include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
@@ -93,11 +94,16 @@ void ClearBrowserDataHandler::InitializeHandler() {
if (AreCountersEnabled()) {
Profile* profile = Profile::FromWebUI(web_ui());
- AddCounter(base::WrapUnique(new PasswordsCounter(profile)));
- AddCounter(base::WrapUnique(new HistoryCounter(profile)));
- AddCounter(base::WrapUnique(new CacheCounter(profile)));
- AddCounter(base::WrapUnique(new AutofillCounter(profile)));
- AddCounter(base::WrapUnique(new MediaLicensesCounter(profile)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeletePasswords, profile)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteBrowsingHistory, profile)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteCache, profile)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteFormData, profile)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteMediaLicenses, profile)));
sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile);
if (sync_service_)

Powered by Google App Engine
This is Rietveld 408576698