diff options
author | ahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-11 22:11:34 +0000 |
---|---|---|
committer | ahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-11 22:11:34 +0000 |
commit | 136fc9188136c5bb8215963e899b4e1f53d014b8 (patch) | |
tree | 09d784ad88ee2c34240530ccbf29598133d0b1c3 /components | |
parent | e232deeb354d695013592c3e9b30167f38633066 (diff) | |
download | chromium_src-136fc9188136c5bb8215963e899b4e1f53d014b8.zip chromium_src-136fc9188136c5bb8215963e899b4e1f53d014b8.tar.gz chromium_src-136fc9188136c5bb8215963e899b4e1f53d014b8.tar.bz2 |
Hiding bubble on navigation, zoom change, and scrolling.
BUG=176340
Review URL: https://chromiumcodereview.appspot.com/12380003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
9 files changed, 29 insertions, 20 deletions
diff --git a/components/autofill/browser/autocheckout_manager_unittest.cc b/components/autofill/browser/autocheckout_manager_unittest.cc index 28a6c57..1dec918 100644 --- a/components/autofill/browser/autocheckout_manager_unittest.cc +++ b/components/autofill/browser/autocheckout_manager_unittest.cc @@ -220,6 +220,8 @@ class MockAutofillManagerDelegate : public TestAutofillManagerDelegate { callback.Run(); } + virtual void HideAutocheckoutBubble() OVERRIDE {} + virtual void ShowRequestAutocompleteDialog( const FormData& form, const GURL& source_url, diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc index 5d9f5ac..d7072f2 100644 --- a/components/autofill/browser/autofill_manager.cc +++ b/components/autofill/browser/autofill_manager.cc @@ -340,8 +340,8 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) { OnDidShowAutofillSuggestions) IPC_MESSAGE_HANDLER(AutofillHostMsg_DidEndTextFieldEditing, OnDidEndTextFieldEditing) - IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillPopup, - OnHideAutofillPopup) + IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillUi, + OnHideAutofillUi) IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup, OnShowPasswordGenerationPopup) IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping, @@ -719,9 +719,10 @@ void AutofillManager::OnDidShowAutofillSuggestions(bool is_new_popup) { } } -void AutofillManager::OnHideAutofillPopup() { +void AutofillManager::OnHideAutofillUi() { if (IsNativeUiEnabled()) manager_delegate_->HideAutofillPopup(); + manager_delegate_->HideAutocheckoutBubble(); } void AutofillManager::OnShowPasswordGenerationPopup( diff --git a/components/autofill/browser/autofill_manager.h b/components/autofill/browser/autofill_manager.h index 094043a..99c4a3d 100644 --- a/components/autofill/browser/autofill_manager.h +++ b/components/autofill/browser/autofill_manager.h @@ -246,7 +246,7 @@ class AutofillManager : public content::WebContentsObserver, const gfx::RectF& bounding_box, bool display_warning); void OnDidEndTextFieldEditing(); - void OnHideAutofillPopup(); + void OnHideAutofillUi(); void OnAddPasswordFormMapping( const FormFieldData& form, const PasswordFormFillData& fill_data); diff --git a/components/autofill/browser/autofill_manager_delegate.h b/components/autofill/browser/autofill_manager_delegate.h index 1e228e1..36245ad 100644 --- a/components/autofill/browser/autofill_manager_delegate.h +++ b/components/autofill/browser/autofill_manager_delegate.h @@ -119,6 +119,9 @@ class AutofillManagerDelegate { DialogType dialog_type, const base::Callback<void(const FormStructure*)>& callback) = 0; + // Hide the Autocheckout bubble if one is currently showing. + virtual void HideAutocheckoutBubble() = 0; + // Called when the dialog for request autocomplete closes. (So UI code will // free memory, etc.) virtual void RequestAutocompleteDialogClosed() = 0; diff --git a/components/autofill/browser/test_autofill_manager_delegate.cc b/components/autofill/browser/test_autofill_manager_delegate.cc index 7c8d834..815d295 100644 --- a/components/autofill/browser/test_autofill_manager_delegate.cc +++ b/components/autofill/browser/test_autofill_manager_delegate.cc @@ -49,6 +49,8 @@ void TestAutofillManagerDelegate::ShowAutocheckoutBubble( const gfx::NativeView& native_view, const base::Closure& callback) {} +void TestAutofillManagerDelegate::HideAutocheckoutBubble() {} + void TestAutofillManagerDelegate::ShowRequestAutocompleteDialog( const FormData& form, const GURL& source_url, diff --git a/components/autofill/browser/test_autofill_manager_delegate.h b/components/autofill/browser/test_autofill_manager_delegate.h index 64873c02..4478903 100644 --- a/components/autofill/browser/test_autofill_manager_delegate.h +++ b/components/autofill/browser/test_autofill_manager_delegate.h @@ -39,6 +39,7 @@ class TestAutofillManagerDelegate : public AutofillManagerDelegate { const gfx::RectF& bounding_box, const gfx::NativeView& native_view, const base::Closure& callback) OVERRIDE; + virtual void HideAutocheckoutBubble() OVERRIDE; virtual void ShowRequestAutocompleteDialog( const FormData& form, const GURL& source_url, diff --git a/components/autofill/common/autofill_messages.h b/components/autofill/common/autofill_messages.h index 0583eb0..69649cc 100644 --- a/components/autofill/common/autofill_messages.h +++ b/components/autofill/common/autofill_messages.h @@ -239,8 +239,8 @@ IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog) // Send when a text field is done editing. IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) -// Instructs the browser to hide the Autofill popup. -IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillPopup) +// Instructs the browser to hide the Autofill UI. +IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillUi) // Sent when the renderer attempts to click an element in an Autocheckout flow // and either the element could not be found or the click did not have the diff --git a/components/autofill/renderer/autofill_agent.cc b/components/autofill/renderer/autofill_agent.cc index fb3cf4a..5320ba0 100644 --- a/components/autofill/renderer/autofill_agent.cc +++ b/components/autofill/renderer/autofill_agent.cc @@ -254,11 +254,11 @@ void AutofillAgent::ZoomLevelChanged() { // Any time the zoom level changes, the page's content moves, so any Autofill // popups should be hidden. This is only needed for the new Autofill UI // because WebKit already knows to hide the old UI when this occurs. - HideHostPopups(); + HideHostAutofillUi(); } void AutofillAgent::DidChangeScrollOffset(WebKit::WebFrame*) { - HidePopups(); + HideAutofillUi(); } void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame, @@ -278,7 +278,7 @@ void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame, // Cancel any pending Autofill requests and hide any currently showing popups. ++autofill_query_id_; - HidePopups(); + HideAutofillUi(); in_flight_request_form_ = form; // TODO(ramankk): Include SSLStatus within form_data and update the IPC. @@ -303,7 +303,7 @@ bool AutofillAgent::InputElementClicked(const WebInputElement& element, } bool AutofillAgent::InputElementLostFocus() { - HideHostPopups(); + HideHostAutofillUi(); return false; } @@ -547,7 +547,7 @@ void AutofillAgent::CombineDataListEntriesAndShow( if (v.empty()) { // No suggestions, any popup currently showing is obsolete. - HidePopups(); + HideAutofillUi(); return; } @@ -717,7 +717,7 @@ void AutofillAgent::ShowSuggestions(const WebInputElement& element, (element.selectionStart() != element.selectionEnd() || element.selectionEnd() != static_cast<int>(value.length())))) { // Any popup currently showing is obsolete. - HidePopups(); + HideAutofillUi(); return; } @@ -843,16 +843,16 @@ void AutofillAgent::SetNodeText(const string16& value, node->setEditingValue(substring); } -void AutofillAgent::HidePopups() { +void AutofillAgent::HideAutofillUi() { WebKit::WebView* web_view = render_view()->GetWebView(); if (web_view) web_view->hidePopups(); - HideHostPopups(); + HideHostAutofillUi(); } -void AutofillAgent::HideHostPopups() { - Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); +void AutofillAgent::HideHostAutofillUi() { + Send(new AutofillHostMsg_HideAutofillUi(routing_id())); } } // namespace autofill diff --git a/components/autofill/renderer/autofill_agent.h b/components/autofill/renderer/autofill_agent.h index 5b24013..18c2d56 100644 --- a/components/autofill/renderer/autofill_agent.h +++ b/components/autofill/renderer/autofill_agent.h @@ -194,11 +194,11 @@ class AutofillAgent : public content::RenderViewObserver, // Set |node| to display the given |value|. void SetNodeText(const string16& value, WebKit::WebInputElement* node); - // Hides any currently showing Autofill popups in the renderer or browser. - void HidePopups(); + // Hides any currently showing Autofill UI in the renderer or browser. + void HideAutofillUi(); - // Hides any currently showing Autofill popups in the browser only. - void HideHostPopups(); + // Hides any currently showing Autofill UI in the browser only. + void HideHostAutofillUi(); FormCache form_cache_; |