Chromium Code Reviews| Index: chrome/browser/autofill/autofill_manager.cc |
| diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc |
| index b9d133e257f5a1b733d2d9f868fb457caf3ae5c7..97d42e71fbf68c3f4f733477d669f12dcce9e7ca 100644 |
| --- a/chrome/browser/autofill/autofill_manager.cc |
| +++ b/chrome/browser/autofill/autofill_manager.cc |
| @@ -415,7 +415,7 @@ void AutofillManager::OnFormSubmitted(const FormData& form) { |
| if (!IsAutofillEnabled()) |
| return; |
| - if (tab_contents()->profile()->IsOffTheRecord()) |
| + if (tab_contents()->browser_context()->IsOffTheRecord()) |
| return; |
| // Don't save data that was submitted through JavaScript. |
| @@ -696,7 +696,7 @@ void AutofillManager::OnFillAutofillFormData(int query_id, |
| void AutofillManager::OnShowAutofillDialog() { |
| Browser* browser = BrowserList::GetLastActiveWithProfile( |
| - tab_contents()->profile()); |
| + static_cast<Profile*>(tab_contents()->browser_context())); |
|
Ilya Sherman
2011/07/21 22:29:23
I really don't like that clients need to magically
|
| if (browser) |
| browser->ShowOptionsTab(chrome::kAutofillSubPage); |
| } |
| @@ -745,8 +745,9 @@ void AutofillManager::OnServerRequestError( |
| } |
| bool AutofillManager::IsAutofillEnabled() const { |
| - return const_cast<AutofillManager*>(this)->tab_contents()->profile()-> |
| - GetPrefs()->GetBoolean(prefs::kAutofillEnabled); |
| + Profile* profile = static_cast<Profile*>( |
| + const_cast<AutofillManager*>(this)->tab_contents()->browser_context()); |
| + return profile->GetPrefs()->GetBoolean(prefs::kAutofillEnabled); |
|
Ilya Sherman
2011/07/21 22:29:23
Similar question here: Are all clients of GetPrefs
|
| } |
| void AutofillManager::DeterminePossibleFieldTypesForUpload( |