diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 20:21:11 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 20:21:11 +0000 |
commit | cfd727ff8ea3e853a5e2f7c39cd1902fac090ecb (patch) | |
tree | e4f752f4fa1c3985abe91af25e7918c90a59768f /webkit/glue | |
parent | 9b341774ce43e4034ac4465997b31e7b15fa1928 (diff) | |
download | chromium_src-cfd727ff8ea3e853a5e2f7c39cd1902fac090ecb.zip chromium_src-cfd727ff8ea3e853a5e2f7c39cd1902fac090ecb.tar.gz chromium_src-cfd727ff8ea3e853a5e2f7c39cd1902fac090ecb.tar.bz2 |
The popup for autofill is now never activated, even when clicked.
This allows us to hide it when the page loses focus.
(doing that previously would have caused the popup to be hidden before the click in the popup was sent to the renderer).
Most of the file changes are just renaming focus_on_show to activatable.
TEST=Open a form and make an autofill popup. Focus another window, the popup should disappear. Ensure the autofill still work properly, and the combo-box as well.
BUG=3844,5830
Review URL: http://codereview.chromium.org/17455
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 4 | ||||
-rw-r--r-- | webkit/glue/chrome_client_impl.h | 2 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 3 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 12 |
4 files changed, 7 insertions, 14 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 471eb14..278134b 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -462,12 +462,12 @@ void ChromeClientImpl::runOpenPanel(WebCore::Frame* frame, void ChromeClientImpl::popupOpened(WebCore::FramelessScrollView* popup_view, const WebCore::IntRect& bounds, - bool focus_on_show) { + bool activatable) { WebViewDelegate* d = webview_->delegate(); if (d) { WebWidgetImpl* webwidget = static_cast<WebWidgetImpl*>(d->CreatePopupWidget(webview_, - focus_on_show)); + activatable)); webwidget->Init(popup_view, webkit_glue::FromIntRect(bounds)); } } diff --git a/webkit/glue/chrome_client_impl.h b/webkit/glue/chrome_client_impl.h index 6e059eaa..226c93c 100644 --- a/webkit/glue/chrome_client_impl.h +++ b/webkit/glue/chrome_client_impl.h @@ -117,7 +117,7 @@ public: PassRefPtr<WebCore::FileChooser>); virtual void popupOpened(WebCore::FramelessScrollView* popup_view, const WebCore::IntRect& bounds, - bool focus_on_show); + bool activatable); void SetCursor(const WebCursor& cursor); void SetCursorForPlugin(const WebCursor& cursor); diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 0ffd764..b2fca89 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -114,8 +114,7 @@ class WebViewDelegate : virtual public WebWidgetDelegate { // This method is called to create a new WebWidget to act as a popup // (like a drop-down menu). - virtual WebWidget* CreatePopupWidget(WebView* webview, - bool focus_on_show) { + virtual WebWidget* CreatePopupWidget(WebView* webview, bool activatable) { return NULL; } diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 59ffd3b..ac5588c 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -943,14 +943,6 @@ void WebViewImpl::SetBackForwardListSize(int size) { void WebViewImpl::SetFocus(bool enable) { if (enable) { - // Hide the popup menu if any. - // TODO(jcampan): bug #3844: we should do that when we lose focus. The - // reason we are not doing it is because when clicking on the autofill - // popup, the page first loses focus before the mouse click is sent to the - // popup. So if we close when the focus is lost, the mouse click does not - // do anything. - HideAutoCompletePopup(); - // Getting the focused frame will have the side-effect of setting the main // frame as the focused frame if it is not already focused. Otherwise, if // there is already a focused frame, then this does nothing. @@ -967,6 +959,8 @@ void WebViewImpl::SetFocus(bool enable) { } ime_accept_events_ = true; } else { + HideAutoCompletePopup(); + // Clear out who last had focus. If someone has focus, the refs will be // updated below. ReleaseFocusReferences(); @@ -1509,7 +1503,7 @@ void WebViewImpl::AutofillSuggestionsForNode( adoptRef(new AutocompletePopupMenuClient(this, input_elem, suggestions, default_suggestion_index)); - // Autocomplete popup does not get focused. We need the page to still + // The autocomplete popup is not activated. We need the page to still // have focus so the user can keep typing when the popup is showing. autocomplete_popup_ = WebCore::PopupContainer::create(autocomplete_popup_client_.get(), |