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

Unified Diff: chrome/browser/ui/webui/settings/settings_clear_browsing_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/settings/settings_clear_browsing_data_handler.cc
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
index ea235fab38ea5438c83fe98b847a90568b04d54d..266473244a26b9016e6df16fbcf96ade177e28d3 100644
--- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
@@ -11,6 +11,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.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_factory.h"
@@ -216,13 +217,20 @@ void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) {
AllowJavascript();
// TODO(msramek): Simplify this using a factory.
msramek 2016/07/07 11:55:33 We're already using a factory, but (apart from rem
ioanap 2016/07/07 16:30:48 Thank you! Done.
- AddCounter(base::WrapUnique(new AutofillCounter(profile_)));
- AddCounter(base::WrapUnique(new CacheCounter(profile_)));
- AddCounter(base::WrapUnique(new DownloadsCounter(profile_)));
- AddCounter(base::WrapUnique(new HistoryCounter(profile_)));
- AddCounter(base::WrapUnique(new HostedAppsCounter(profile_)));
- AddCounter(base::WrapUnique(new PasswordsCounter(profile_)));
- AddCounter(base::WrapUnique(new MediaLicensesCounter(profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteFormData, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteCache, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteDownloadHistory, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteBrowsingHistory, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteHostedAppsData, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeletePasswords, profile_)));
+ AddCounter(base::WrapUnique(BrowsingDataCounterFactory::GetForPreference(
+ prefs::kDeleteMediaLicenses, profile_)));
OnStateChanged();
RefreshHistoryNotice();

Powered by Google App Engine
This is Rietveld 408576698