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

Unified Diff: chrome/browser/autofill/personal_data_manager.cc

Issue 10828345: Extract PrefServiceBase into chrome/browser/api. Use in api and autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 4 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/autofill/personal_data_manager.cc
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 161a9cc8f933799b9d8c6253af5e9a128ba46814..4e861982274bc7587e7e8a2ab3a5871b48855050 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/autofill/phone_number.h"
#include "chrome/browser/autofill/phone_number_i18n.h"
#include "chrome/browser/autofill/select_control_handler.h"
-#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/api/prefs/pref_service_base.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
@@ -170,7 +170,8 @@ void PersonalDataManager::OnWebDataServiceRequestDone(
ProfileSyncService* sync_service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
if (sync_service && (!sync_service->HasSyncSetupCompleted() ||
- !profile_->GetPrefs()->GetBoolean(prefs::kSyncAutofill))) {
+ !PrefServiceBase::ForProfile(profile_)->GetBoolean(
+ prefs::kSyncAutofill))) {
scoped_refptr<WebDataService> web_data_service =
WebDataServiceFactory::GetForProfile(profile_,
Profile::EXPLICIT_ACCESS);
@@ -533,8 +534,10 @@ bool PersonalDataManager::IsDataLoaded() const {
const std::vector<AutofillProfile*>& PersonalDataManager::profiles() const {
// |profile_| is NULL in AutofillManagerTest.
- bool auxiliary_profiles_enabled = profile_ ? profile_->GetPrefs()->GetBoolean(
- prefs::kAutofillAuxiliaryProfilesEnabled) : false;
+ bool auxiliary_profiles_enabled = profile_ ?
+ PrefServiceBase::ForProfile(profile_)->GetBoolean(
+ prefs::kAutofillAuxiliaryProfilesEnabled) :
+ false;
if (!auxiliary_profiles_enabled)
return web_profiles();
@@ -595,7 +598,8 @@ void PersonalDataManager::Init(Profile* profile) {
}
bool PersonalDataManager::IsAutofillEnabled() const {
- return profile_->GetPrefs()->GetBoolean(prefs::kAutofillEnabled);
+ return PrefServiceBase::ForProfile(profile_)->GetBoolean(
+ prefs::kAutofillEnabled);
}
// static
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/captive_portal/captive_portal_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698