Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 #include <map> | |
| 10 | |
| 11 #include "content/common/content_export.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 class WebMouseEvent; | |
| 15 class WebMouseWheelEvent; | |
| 16 } | |
| 17 | |
| 18 namespace gfx { | |
| 19 class Point; | |
| 20 } | |
| 21 | |
| 22 namespace content { | |
| 23 | |
| 24 class RenderWidgetHostViewBase; | |
| 25 | |
| 26 // Class owned by WebContentsImpl for the purpose of directing input events | |
| 27 // to the correct RenderWidgetHost on pages with multiple RenderWidgetHosts. | |
| 28 // It maintains a mapping of RenderWidgetHostViews to Surface IDs that they | |
| 29 // own. When an input event requires routing based on window coordinates, | |
| 30 // this class requests a Surface hit test from the provided |root_view| and | |
| 31 // forwards the event to the owning RWHV of the returned Surface ID. | |
| 32 class CONTENT_EXPORT RenderWidgetHostInputEventRouter { | |
| 33 public: | |
| 34 RenderWidgetHostInputEventRouter(); | |
| 35 virtual ~RenderWidgetHostInputEventRouter(); | |
|
dcheng
2015/08/31 23:45:54
Why virtual? I don't see any overrides.
kenrb
2015/09/01 15:56:16
I thought I might need it for unit tests, but didn
| |
| 36 | |
| 37 void RouteMouseEvent(RenderWidgetHostViewBase* root_view, | |
| 38 blink::WebMouseEvent* event); | |
| 39 void RouteMouseWheelEvent(RenderWidgetHostViewBase* root_view, | |
| 40 blink::WebMouseWheelEvent* event); | |
| 41 | |
| 42 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | |
| 43 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | |
| 44 | |
| 45 private: | |
| 46 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, | |
| 47 const gfx::Point& point, | |
| 48 gfx::Point* transformed_point); | |
| 49 | |
| 50 typedef std::map<uint32_t, RenderWidgetHostViewBase*> | |
|
piman
2015/08/31 23:45:14
nit: hash_map?
kenrb
2015/09/01 15:56:16
Done.
| |
| 51 SurfaceIdNamespaceOwnerMap; | |
| 52 SurfaceIdNamespaceOwnerMap owner_map_; | |
| 53 }; | |
|
dcheng
2015/08/31 23:45:54
DISALLOW_COPY_AND_ASSIGN?
kenrb
2015/09/01 15:56:16
Done.
| |
| 54 | |
| 55 } // namespace content | |
| 56 | |
| 57 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ | |
| OLD | NEW |