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 4b5094903ca815ca029ee36dc7c6bd85cb749490..71b90b38d8d1f22a1c23c5528db5fbe378a65bc1 100644 |
| --- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| +++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc |
| @@ -6,13 +6,10 @@ |
| #include "base/logging.h" |
| #include "base/prefs/pref_service.h" |
| -#include "chrome/browser/autofill/autocheckout_whitelist_manager_factory.h" |
| #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
| #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| #include "chrome/browser/infobars/infobar_service.h" |
| #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.h" |
| #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| #include "chrome/browser/ui/browser.h" |
| @@ -69,24 +66,6 @@ PrefService* TabAutofillManagerDelegate::GetPrefs() { |
| GetPrefs(); |
| } |
| -autocheckout::WhitelistManager* |
| -TabAutofillManagerDelegate::GetAutocheckoutWhitelistManager() const { |
| - Profile* profile = |
| - Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| - return autocheckout::WhitelistManagerFactory::GetForProfile( |
| - profile->GetOriginalProfile()); |
| -} |
| - |
| -void TabAutofillManagerDelegate::OnAutocheckoutError() { |
| - // |dialog_controller_| 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(); |
| -} |
| - |
| -void TabAutofillManagerDelegate::OnAutocheckoutSuccess() { |
| - dialog_controller_->OnAutocheckoutSuccess(); |
| -} |
| - |
| void TabAutofillManagerDelegate::ShowAutofillSettings() { |
| #if defined(OS_ANDROID) |
| NOTIMPLEMENTED(); |
| @@ -107,43 +86,6 @@ void TabAutofillManagerDelegate::ConfirmSaveCreditCard( |
| infobar_service, &metric_logger, save_card_callback); |
| } |
| -bool TabAutofillManagerDelegate::ShowAutocheckoutBubble( |
| - const gfx::RectF& bounding_box, |
| - bool is_google_user, |
| - const base::Callback<void(AutocheckoutBubbleState)>& callback) { |
| -#if !defined(TOOLKIT_VIEWS) |
| - callback.Run(AUTOCHECKOUT_BUBBLE_CANCELED); |
| - NOTIMPLEMENTED(); |
| - return false; |
| -#else |
| - HideAutocheckoutBubble(); |
| - |
| - // Convert |bounding_box| to be in screen space. |
| - gfx::Rect container_rect; |
| - web_contents_->GetView()->GetContainerBounds(&container_rect); |
| - 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))); |
| - |
| - if (!autocheckout_bubble_) |
| - return false; |
| - |
| - autocheckout_bubble_->ShowBubble(); |
| - return true; |
| -#endif // #if !defined(TOOLKIT_VIEWS) |
| -} |
| - |
| -void TabAutofillManagerDelegate::HideAutocheckoutBubble() { |
| - if (autocheckout_bubble_.get()) |
| - autocheckout_bubble_->HideBubble(); |
| -} |
| - |
| void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
| const FormData& form, |
| const GURL& source_url, |
| @@ -202,17 +144,6 @@ void TabAutofillManagerDelegate::HideAutofillPopup() { |
| popup_controller_->Hide(); |
| } |
| -void TabAutofillManagerDelegate::AddAutocheckoutStep( |
| - AutocheckoutStepType step_type) { |
| - dialog_controller_->AddAutocheckoutStep(step_type); |
| -} |
| - |
| -void TabAutofillManagerDelegate::UpdateAutocheckoutStep( |
| - AutocheckoutStepType step_type, |
| - AutocheckoutStepStatus step_status) { |
| - dialog_controller_->UpdateAutocheckoutStep(step_type, step_status); |
| -} |
| - |
| bool TabAutofillManagerDelegate::IsAutocompleteEnabled() { |
| // For browser, Autocomplete is always enabled as part of Autofill. |
| return GetPrefs()->GetBoolean(prefs::kAutofillEnabled); |
| @@ -234,20 +165,14 @@ void TabAutofillManagerDelegate::DidNavigateMainFrame( |
| const content::LoadCommittedDetails& details, |
| const content::FrameNavigateParams& params) { |
|
Ilya Sherman
2013/08/27 18:57:57
nit: Spurious blank line.
Raman Kakilate
2013/08/27 21:52:59
Done.
|
| - HideAutocheckoutBubble(); |
| - |
| if (!dialog_controller_.get()) |
| return; |
| - // A redirect immediately after a successful Autocheckout flow shouldn't hide |
| - // the dialog. |
| - bool preserve_dialog = AutofillDriverImpl::FromWebContents(web_contents())-> |
| - autofill_manager()->autocheckout_manager()->should_preserve_dialog(); |
| bool was_redirect = details.entry && |
| content::PageTransitionIsRedirect(details.entry->GetTransitionType()); |
| if (dialog_controller_->GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE || |
| - (!was_redirect && !preserve_dialog)) { |
| + !was_redirect) { |
| HideRequestAutocompleteDialog(); |
| } |
| } |