diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 19:11:11 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 19:11:11 +0000 |
commit | a31c0d30aadeaf023b09162db4ac5f9f04dafaa4 (patch) | |
tree | eb630fd6ac671ac8d648589ac9ba386cd7392282 /content/browser | |
parent | 059d2be690edceee4203e0ba5f217b909cb0f28f (diff) | |
download | chromium_src-a31c0d30aadeaf023b09162db4ac5f9f04dafaa4.zip chromium_src-a31c0d30aadeaf023b09162db4ac5f9f04dafaa4.tar.gz chromium_src-a31c0d30aadeaf023b09162db4ac5f9f04dafaa4.tar.bz2 |
Do not forward keyevents to popup if that's expected.
Popup is also used for auto-completions in <input type="text"> and
in case further keyevent should be sent to the <input>.
BUG=110265
TEST=manually
Review URL: http://codereview.chromium.org/9192006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 9 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index ccc695c..6b0bd84 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -550,7 +550,7 @@ void RenderWidgetHostViewAura::InsertText(const string16& text) { } void RenderWidgetHostViewAura::InsertChar(char16 ch, int flags) { - if (popup_child_host_view_) { + if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { popup_child_host_view_->InsertChar(ch, flags); return; } @@ -710,7 +710,8 @@ void RenderWidgetHostViewAura::OnBlur() { } bool RenderWidgetHostViewAura::OnKeyEvent(aura::KeyEvent* event) { - if (popup_child_host_view_ && popup_child_host_view_->OnKeyEvent(event)) + if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() && + popup_child_host_view_->OnKeyEvent(event)) return true; // We need to handle the Escape key for Pepper Flash. @@ -906,6 +907,10 @@ void RenderWidgetHostViewAura::SchedulePaintIfNotInClip( } } +bool RenderWidgetHostViewAura::NeedsInputGrab() { + return popup_type_ == WebKit::WebPopupTypeSelect; +} + //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostView, public: diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index cb70acf..361ca86 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -173,6 +173,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura void UpdateExternalTexture(); ui::InputMethod* GetInputMethod() const; + // Returns whether the widget needs an input grab to work properly. + bool NeedsInputGrab(); + // Confirm existing composition text in the webpage and ask the input method // to cancel its ongoing composition session. void FinishImeCompositionSession(); |