| 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 9be39c145d125c0432dec8920175ed9ef3757eab..df4ee00a40e7dee124abda408608d0d07140eaf2 100644
|
| --- a/chrome/browser/autofill/personal_data_manager.cc
|
| +++ b/chrome/browser/autofill/personal_data_manager.cc
|
| @@ -167,13 +167,13 @@ void PersonalDataManager::OnWebDataServiceRequestDone(
|
| // If sync is not set, cull older entries of the autocomplete. Otherwise,
|
| // the entries will be culled when sync is connected.
|
| ProfileSyncServiceBase* sync_service =
|
| - ProfileSyncServiceBase::ForContext(browser_context_);
|
| + ProfileSyncServiceBase::FromBrowserContext(browser_context_);
|
| if (sync_service && (!sync_service->HasSyncSetupCompleted() ||
|
| - !PrefServiceBase::ForContext(
|
| + !PrefServiceBase::FromBrowserContext(
|
| browser_context_)->GetBoolean(
|
| prefs::kSyncAutofill))) {
|
| scoped_ptr<AutofillWebDataService> service(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (service.get())
|
| service->RemoveExpiredFormElements();
|
| }
|
| @@ -201,14 +201,14 @@ void PersonalDataManager::OnStateChanged() {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get()) {
|
| NOTREACHED();
|
| return;
|
| }
|
|
|
| ProfileSyncServiceBase* sync_service =
|
| - ProfileSyncServiceBase::ForContext(browser_context_);
|
| + ProfileSyncServiceBase::FromBrowserContext(browser_context_);
|
| if (!sync_service)
|
| return;
|
|
|
| @@ -231,7 +231,7 @@ void PersonalDataManager::Observe(int type,
|
|
|
| if (DCHECK_IS_ON()) {
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
|
|
| DCHECK(autofill_data.get() &&
|
| autofill_data->GetNotificationSource() == source);
|
| @@ -370,7 +370,7 @@ void PersonalDataManager::AddProfile(const AutofillProfile& profile) {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -398,7 +398,7 @@ void PersonalDataManager::UpdateProfile(const AutofillProfile& profile) {
|
| }
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -417,7 +417,7 @@ void PersonalDataManager::RemoveProfile(const std::string& guid) {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -449,7 +449,7 @@ void PersonalDataManager::AddCreditCard(const CreditCard& credit_card) {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -477,7 +477,7 @@ void PersonalDataManager::UpdateCreditCard(const CreditCard& credit_card) {
|
| }
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -496,7 +496,7 @@ void PersonalDataManager::RemoveCreditCard(const std::string& guid) {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -537,7 +537,7 @@ bool PersonalDataManager::IsDataLoaded() const {
|
| const std::vector<AutofillProfile*>& PersonalDataManager::profiles() const {
|
| // |browser_context_| is NULL in AutofillManagerTest.
|
| bool auxiliary_profiles_enabled = browser_context_ ?
|
| - PrefServiceBase::ForContext(browser_context_)->GetBoolean(
|
| + PrefServiceBase::FromBrowserContext(browser_context_)->GetBoolean(
|
| prefs::kAutofillAuxiliaryProfilesEnabled) :
|
| false;
|
| if (!auxiliary_profiles_enabled)
|
| @@ -586,7 +586,7 @@ void PersonalDataManager::Init(BrowserContext* browser_context) {
|
|
|
| // WebDataService may not be available in tests.
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -600,7 +600,7 @@ void PersonalDataManager::Init(BrowserContext* browser_context) {
|
| }
|
|
|
| bool PersonalDataManager::IsAutofillEnabled() const {
|
| - return PrefServiceBase::ForContext(browser_context_)->GetBoolean(
|
| + return PrefServiceBase::FromBrowserContext(browser_context_)->GetBoolean(
|
| prefs::kAutofillEnabled);
|
| }
|
|
|
| @@ -682,7 +682,7 @@ void PersonalDataManager::SetProfiles(std::vector<AutofillProfile>* profiles) {
|
| AutofillProfile::AdjustInferredLabels(&profile_pointers);
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -734,7 +734,7 @@ void PersonalDataManager::SetCreditCards(
|
| credit_cards->end());
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get())
|
| return;
|
|
|
| @@ -774,7 +774,7 @@ void PersonalDataManager::SetCreditCards(
|
|
|
| void PersonalDataManager::LoadProfiles() {
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get()) {
|
| NOTREACHED();
|
| return;
|
| @@ -794,7 +794,7 @@ void PersonalDataManager::LoadAuxiliaryProfiles() const {
|
|
|
| void PersonalDataManager::LoadCreditCards() {
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get()) {
|
| NOTREACHED();
|
| return;
|
| @@ -846,7 +846,7 @@ void PersonalDataManager::CancelPendingQuery(
|
| WebDataServiceBase::Handle* handle) {
|
| if (*handle) {
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get()) {
|
| NOTREACHED();
|
| return;
|
| @@ -916,14 +916,14 @@ void PersonalDataManager::EmptyMigrationTrash() {
|
| return;
|
|
|
| scoped_ptr<AutofillWebDataService> autofill_data(
|
| - AutofillWebDataService::ForContext(browser_context_));
|
| + AutofillWebDataService::FromBrowserContext(browser_context_));
|
| if (!autofill_data.get()) {
|
| NOTREACHED();
|
| return;
|
| }
|
|
|
| ProfileSyncServiceBase* sync_service =
|
| - ProfileSyncServiceBase::ForContext(browser_context_);
|
| + ProfileSyncServiceBase::FromBrowserContext(browser_context_);
|
| if (!sync_service)
|
| return;
|
|
|
|
|