Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 23416003: Add content::RenderWidgetHost::MouseEventCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a callback instead of a single-method interface Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.h
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 2004c0b663c8f5e332a90f44c9839242a230ffde..293df1112ac8efe059cb648dfbe012ce3db3e8c0 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -175,6 +175,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
virtual void WasResized() OVERRIDE;
virtual void AddKeyboardListener(KeyboardListener* listener) OVERRIDE;
virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE;
+ virtual void AddMouseEventCallback(
+ const MouseEventCallback& callback) OVERRIDE;
+ virtual void RemoveMouseEventCallback(
+ const MouseEventCallback& callback) OVERRIDE;
virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) OVERRIDE;
virtual void GetSnapshotFromRenderer(
const gfx::Rect& src_subrect,
@@ -705,6 +709,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
// widgets that don't have focus to still handle key presses.
bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event);
+ // Give mouse event callbacks a chance to handle this mouse event.
+ bool MouseEventCallbacksHandleEvent(const WebKit::WebMouseEvent& event);
+
// InputRouterClient
virtual InputEventAckState FilterInputEvent(
const WebKit::WebInputEvent& event,
@@ -824,6 +831,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
// Keyboard event listeners.
ObserverList<KeyboardListener> keyboard_listeners_;
+ // Mouse event callbacks.
+ std::vector<MouseEventCallback> mouse_event_callbacks_;
+
// If true, then we should repaint when restoring even if we have a
// backingstore. This flag is set to true if we receive a paint message
// while is_hidden_ to true. Even though we tell the render widget to hide

Powered by Google App Engine
This is Rietveld 408576698