Chromium Code Reviews| Index: chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| index 00007baeee69965f984f6c87bbe7ccf2c1fb90a7..ac481d36cebb46a738cd4306ddf0260ae286116a 100644 |
| --- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| +++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| @@ -13,7 +13,7 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/autofill/autocheckout_bubble.h" |
| #include "chrome/browser/ui/autofill/autocheckout_bubble_controller.h" |
| -#include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| +#include "chrome/browser/ui/autofill/autofill_dialog_tab_manager_delegate.h" |
| #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_finder.h" |
| @@ -51,8 +51,8 @@ void TabAutofillManagerDelegate::TabActivated(int reason) { |
| if (reason != TabStripModelObserver::CHANGE_REASON_USER_GESTURE) |
| return; |
| - if (dialog_controller_.get()) |
| - dialog_controller_->TabActivated(); |
| + if (dialog_delegate_.get()) |
| + dialog_delegate_->TabActivated(); |
| } |
| PersonalDataManager* TabAutofillManagerDelegate::GetPersonalDataManager() { |
| @@ -76,13 +76,13 @@ TabAutofillManagerDelegate::GetAutocheckoutWhitelistManager() const { |
| } |
| void TabAutofillManagerDelegate::OnAutocheckoutError() { |
| - // |dialog_controller_| is a WeakPtr, but we require it to be present when |
| + // |dialog_delegate_| is a WeakPtr, but we require it to be present when |
| // |OnAutocheckoutError| is called, so we intentionally do not do NULL check. |
| - dialog_controller_->OnAutocheckoutError(); |
| + dialog_delegate_->OnAutocheckoutError(); |
| } |
| void TabAutofillManagerDelegate::OnAutocheckoutSuccess() { |
| - dialog_controller_->OnAutocheckoutSuccess(); |
| + dialog_delegate_->OnAutocheckoutSuccess(); |
| } |
| void TabAutofillManagerDelegate::ShowAutofillSettings() { |
| @@ -121,12 +121,14 @@ void TabAutofillManagerDelegate::ShowAutocheckoutBubble( |
| gfx::RectF anchor = bounding_box + container_rect.OffsetFromOrigin(); |
| autocheckout_bubble_ = |
| - AutocheckoutBubble::Create(scoped_ptr<AutocheckoutBubbleController>( |
| - new AutocheckoutBubbleController( |
| - anchor, |
| - web_contents_->GetView()->GetTopLevelNativeWindow(), |
| - is_google_user, |
| - callback))); |
| + AutocheckoutBubble::Create( |
| + web_contents_, |
| + scoped_ptr<AutocheckoutBubbleController>( |
| + new AutocheckoutBubbleController( |
| + anchor, |
| + web_contents_->GetView()->GetTopLevelNativeWindow(), |
| + is_google_user, |
| + callback))); |
| autocheckout_bubble_->ShowBubble(); |
| #endif // #if !defined(TOOLKIT_VIEWS) |
| } |
| @@ -144,12 +146,17 @@ void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
| const std::string&)>& callback) { |
| HideRequestAutocompleteDialog(); |
| - dialog_controller_ = AutofillDialogControllerImpl::Create(web_contents_, |
| - form, |
| - source_url, |
| - dialog_type, |
| - callback); |
| - dialog_controller_->Show(); |
| +#if defined(ENABLE_AUTOFILL_DIALOG) |
|
Evan Stade
2013/08/01 19:44:52
I don't think you need this ifdef. Instead do
if
aruslan
2013/08/07 23:17:03
Done.
|
| + dialog_delegate_ = AutofillDialogTabManagerDelegate::Create(web_contents_, |
| + form, |
| + source_url, |
| + dialog_type, |
| + callback); |
| + dialog_delegate_->Show(); |
| +#else |
| + callback.Run(NULL, std::string()); |
| + NOTIMPLEMENTED(); |
| +#endif // #if !defined(ENABLE_AUTOFILL_DIALOG) |
| } |
| void TabAutofillManagerDelegate::ShowAutofillPopup( |
| @@ -191,13 +198,13 @@ void TabAutofillManagerDelegate::HideAutofillPopup() { |
| void TabAutofillManagerDelegate::AddAutocheckoutStep( |
| AutocheckoutStepType step_type) { |
| - dialog_controller_->AddAutocheckoutStep(step_type); |
| + dialog_delegate_->AddAutocheckoutStep(step_type); |
| } |
| void TabAutofillManagerDelegate::UpdateAutocheckoutStep( |
| AutocheckoutStepType step_type, |
| AutocheckoutStepStatus step_status) { |
| - dialog_controller_->UpdateAutocheckoutStep(step_type, step_status); |
| + dialog_delegate_->UpdateAutocheckoutStep(step_type, step_status); |
| } |
| bool TabAutofillManagerDelegate::IsAutocompleteEnabled() { |
| @@ -206,8 +213,8 @@ bool TabAutofillManagerDelegate::IsAutocompleteEnabled() { |
| } |
| void TabAutofillManagerDelegate::HideRequestAutocompleteDialog() { |
| - if (dialog_controller_.get()) |
| - dialog_controller_->Hide(); |
| + if (dialog_delegate_.get()) |
| + dialog_delegate_->Hide(); |
| } |
| void TabAutofillManagerDelegate::DidNavigateMainFrame( |
| @@ -216,7 +223,7 @@ void TabAutofillManagerDelegate::DidNavigateMainFrame( |
| HideAutocheckoutBubble(); |
| - if (!dialog_controller_.get()) |
| + if (!dialog_delegate_.get()) |
| return; |
| // A redirect immediately after a successful Autocheckout flow shouldn't hide |
| @@ -226,7 +233,7 @@ void TabAutofillManagerDelegate::DidNavigateMainFrame( |
| bool was_redirect = details.entry && |
| content::PageTransitionIsRedirect(details.entry->GetTransitionType()); |
| - if (dialog_controller_->dialog_type() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE || |
| + if (dialog_delegate_->GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE || |
| (!was_redirect && !preserve_dialog)) { |
| HideRequestAutocompleteDialog(); |
| } |