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

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

Issue 1255483004: Implement surface-based browser process hit testing for Mac and Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disabled test on Android (not implemented there) Created 5 years, 3 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_input_event_router.h
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.h b/content/browser/renderer_host/render_widget_host_input_event_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a2a967330a9a4a6188444cd3529364ddceb467d
--- /dev/null
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.h
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_
+
+#include <stdint.h>
+
+#include "base/containers/hash_tables.h"
+#include "content/common/content_export.h"
+
+namespace blink {
+class WebMouseEvent;
+class WebMouseWheelEvent;
+}
+
+namespace gfx {
+class Point;
+}
+
+namespace content {
+
+class RenderWidgetHostViewBase;
+
+// Class owned by WebContentsImpl for the purpose of directing input events
+// to the correct RenderWidgetHost on pages with multiple RenderWidgetHosts.
+// It maintains a mapping of RenderWidgetHostViews to Surface IDs that they
+// own. When an input event requires routing based on window coordinates,
+// this class requests a Surface hit test from the provided |root_view| and
+// forwards the event to the owning RWHV of the returned Surface ID.
+class CONTENT_EXPORT RenderWidgetHostInputEventRouter {
+ public:
+ RenderWidgetHostInputEventRouter();
+ ~RenderWidgetHostInputEventRouter();
+
+ void RouteMouseEvent(RenderWidgetHostViewBase* root_view,
+ blink::WebMouseEvent* event);
+ void RouteMouseWheelEvent(RenderWidgetHostViewBase* root_view,
+ blink::WebMouseWheelEvent* event);
+
+ void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner);
+ void RemoveSurfaceIdNamespaceOwner(uint32_t id);
+
+ private:
+ RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view,
+ const gfx::Point& point,
+ gfx::Point* transformed_point);
+
+ typedef base::hash_map<uint32_t, RenderWidgetHostViewBase*>
+ SurfaceIdNamespaceOwnerMap;
+ SurfaceIdNamespaceOwnerMap owner_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_

Powered by Google App Engine
This is Rietveld 408576698