From 30f75e618e08b5bd943feec72261cc36a8fd9280 Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" Date: Wed, 25 Feb 2009 22:01:00 +0000 Subject: This CL causes the autofill popup to hide when the browser window is moved or resized. TEST=Bring up an autofill popup in a form, move the browser. The autofill popup should be closed. BUG=7401 R=ben Review URL: http://codereview.chromium.org/28126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10384 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webview.h | 3 +++ webkit/glue/webview_impl.cc | 6 +++++- webkit/glue/webview_impl.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'webkit/glue') diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h index 7acb29e..fbd4f33f 100644 --- a/webkit/glue/webview.h +++ b/webkit/glue/webview.h @@ -192,6 +192,9 @@ class WebView : public WebWidget { const std::vector& suggestions, int default_suggestion_index) = 0; + // Hides the autofill popup if any are showing. + virtual void HideAutofillPopup() = 0; + private: DISALLOW_EVIL_CONSTRUCTORS(WebView); }; diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 2705168..c0c18c1 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1586,7 +1586,7 @@ void WebViewImpl::AutofillSuggestionsForNode( web_widget, webkit_glue::FromIntRect(new_bounds)); } } else { - autocomplete_popup_->show(focused_node->getRect(), + autocomplete_popup_->show(focused_node->getRect(), page_->mainFrame()->view(), 0); autocomplete_popup_showing_ = true; } @@ -1689,6 +1689,10 @@ void WebViewImpl::HideAutoCompletePopup() { } } +void WebViewImpl::HideAutofillPopup() { + HideAutoCompletePopup(); +} + Node* WebViewImpl::GetFocusedNode() { Frame* frame = page_->focusController()->focusedFrame(); if (!frame) diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index f86e9f1..9023d96 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -104,6 +104,7 @@ class WebViewImpl : public WebView, public base::RefCounted { int64 node_id, const std::vector& suggestions, int default_suggestion_index); + virtual void HideAutofillPopup(); // WebViewImpl -- cgit v1.1