summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.h
diff options
context:
space:
mode:
authorvictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-22 23:49:15 +0000
committervictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-22 23:49:15 +0000
commitc4b220f5233a1b66ac1ba4ae77cb5eaf7d85b925 (patch)
treeff92bab264f895ff44350aa7c9409326a669833f /chrome/renderer/render_widget.h
parent5d461a2e3b47910f0debec79895efecd794f3bf6 (diff)
downloadchromium_src-c4b220f5233a1b66ac1ba4ae77cb5eaf7d85b925.zip
chromium_src-c4b220f5233a1b66ac1ba4ae77cb5eaf7d85b925.tar.gz
chromium_src-c4b220f5233a1b66ac1ba4ae77cb5eaf7d85b925.tar.bz2
Do not send extra blur and focus events if popup menu is showing
Add flag to RenderWidget to remember the popup menu state and suppress focus / blur events when popup menu is showing. This fixes the issue that extra focus / blur events are fired after select control is clicked. R=darin BUG=23499 TEST=none Review URL: http://codereview.chromium.org/647047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.h')
-rw-r--r--chrome/renderer/render_widget.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index d8aca5b..571ca8b 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -105,6 +105,10 @@ class RenderWidget : public IPC::Channel::Listener,
// Close the underlying WebWidget.
virtual void Close();
+ // Set owner widget who creates this popup menu. This is used to inform
+ // owner that popup menu is closed.
+ void SetPopupMenuOwnerWidget(RenderWidget* widget);
+
protected:
// Friend RefCounted so that the dtor can be non-public. Using this class
// without ref-counting is an error.
@@ -204,6 +208,9 @@ class RenderWidget : public IPC::Channel::Listener,
// just handled.
virtual void DidHandleKeyEvent() {}
+ // Reset the popup menu state when it is closed.
+ void PopupMenuClosed();
+
// Routing ID that allows us to communicate to the parent browser process
// RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
int32 routing_id_;
@@ -315,6 +322,15 @@ class RenderWidget : public IPC::Channel::Listener,
// Indicates if the next sequence of Char events should be suppressed or not.
bool suppress_next_char_events_;
+ // These are for popup menu so the focus and blur events can be dispatched
+ // properly.
+ //
+ // Whether this RenderWidget is showing a popup menu widget.
+ bool showing_popup_menu_;
+ // This is for popup menu RenderWidget to remember its owner so it could
+ // inform the owner that popup menu is closed.
+ scoped_refptr<RenderWidget> popup_menu_owner_widget_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidget);
};