Chromium Code Reviews| 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(); |