 Chromium Code Reviews
 Chromium Code Reviews Issue 1255483004:
  Implement surface-based browser process hit testing for Mac and Aura  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1255483004:
  Implement surface-based browser process hit testing for Mac and Aura  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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..f2a0b6432f7e7fd771c31e757f5b2598ab965bda | 
| --- /dev/null | 
| +++ b/content/browser/renderer_host/render_widget_host_input_event_router.h | 
| @@ -0,0 +1,57 @@ | 
| +// 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 <map> | 
| + | 
| +#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(); | 
| + 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
 | 
| + | 
| + 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 std::map<uint32_t, RenderWidgetHostViewBase*> | 
| 
piman
2015/08/31 23:45:14
nit: hash_map?
 
kenrb
2015/09/01 15:56:16
Done.
 | 
| + SurfaceIdNamespaceOwnerMap; | 
| + SurfaceIdNamespaceOwnerMap owner_map_; | 
| +}; | 
| 
dcheng
2015/08/31 23:45:54
DISALLOW_COPY_AND_ASSIGN?
 
kenrb
2015/09/01 15:56:16
Done.
 | 
| + | 
| +} // namespace content | 
| + | 
| +#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ |