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

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 52713006: Parameterize the PrefService that PersonalDataManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 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: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 44ec88f5278ce44a481f32b240365efed059094c..3dfc51d30637b0b9d396ddc7f31dccc295d97a46 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -156,8 +156,10 @@ PersonalDataManager::PersonalDataManager(const std::string& app_locale)
metric_logger_(new AutofillMetrics),
has_logged_profile_count_(false) {}
-void PersonalDataManager::Init(content::BrowserContext* browser_context) {
+void PersonalDataManager::Init(content::BrowserContext* browser_context,
+ PrefService* pref_service) {
browser_context_ = browser_context;
+ pref_service_ = pref_service;
if (!browser_context_->IsOffTheRecord())
metric_logger_->LogIsAutofillEnabledAtStartup(IsAutofillEnabled());
@@ -549,8 +551,7 @@ bool PersonalDataManager::IsDataLoaded() const {
}
const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles() const {
- if (!user_prefs::UserPrefs::Get(browser_context_)->GetBoolean(
- prefs::kAutofillAuxiliaryProfilesEnabled)) {
+ if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)) {
return web_profiles();
}
@@ -704,8 +705,7 @@ void PersonalDataManager::GetCreditCardSuggestions(
}
bool PersonalDataManager::IsAutofillEnabled() const {
- return user_prefs::UserPrefs::Get(browser_context_)->GetBoolean(
- prefs::kAutofillEnabled);
+ return pref_service_->GetBoolean(prefs::kAutofillEnabled);
}
// static

Powered by Google App Engine
This is Rietveld 408576698