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 b4b15d3b832a48a855e054908db8a10fa38ea8b9..134abe1dde5d520f01c93a18369cef3a244936aa 100644 |
--- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc |
+++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc |
@@ -22,7 +22,6 @@ |
#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.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" |
@@ -39,6 +38,7 @@ |
#include "chrome/common/pref_names.h" |
#include "chrome/grit/generated_resources.h" |
#include "chrome/grit/locale_settings.h" |
+#include "components/browsing_data/counters/browsing_data_counter.h" |
#include "components/browsing_data_ui/history_notice_utils.h" |
#include "components/google/core/browser/google_util.h" |
#include "components/prefs/pref_service.h" |
@@ -92,13 +92,13 @@ void ClearBrowserDataHandler::InitializeHandler() { |
base::Unretained(this))); |
if (AreCountersEnabled()) { |
- AddCounter(base::WrapUnique(new PasswordsCounter())); |
- AddCounter(base::WrapUnique(new HistoryCounter())); |
- AddCounter(base::WrapUnique(new CacheCounter())); |
- AddCounter(base::WrapUnique(new AutofillCounter())); |
+ 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))); |
- sync_service_ = |
- ProfileSyncServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); |
+ sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile); |
if (sync_service_) |
sync_service_->AddObserver(this); |
} |
@@ -317,10 +317,8 @@ void ClearBrowserDataHandler::HandleClearBrowserData( |
remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile); |
remover_->AddObserver(this); |
int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod); |
- remover_->Remove( |
- BrowsingDataRemover::Period( |
- static_cast<BrowsingDataRemover::TimePeriod>(period_selected)), |
- remove_mask, origin_mask); |
+ remover_->Remove(Period(static_cast<TimePeriod>(period_selected)), |
+ remove_mask, origin_mask); |
// Store the clear browsing data time. Next time the clear browsing data |
// dialog is open, this time is used to decide whether to display an info |
@@ -370,10 +368,10 @@ void ClearBrowserDataHandler::AddCounter( |
std::unique_ptr<BrowsingDataCounter> counter) { |
DCHECK(AreCountersEnabled()); |
- counter->Init( |
- Profile::FromWebUI(web_ui()), |
- base::Bind(&ClearBrowserDataHandler::UpdateCounterText, |
- base::Unretained(this))); |
+ counter->Init(Profile::FromWebUI(web_ui())->GetPrefs(), |
+ prefs::kDeleteTimePeriod, |
+ base::Bind(&ClearBrowserDataHandler::UpdateCounterText, |
+ base::Unretained(this))); |
counters_.push_back(std::move(counter)); |
} |