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

Side by Side 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 unified diff | Download patch
OLDNEW
(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
10 #include "base/containers/hash_tables.h"
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 ~RenderWidgetHostInputEventRouter();
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 base::hash_map<uint32_t, RenderWidgetHostViewBase*>
51 SurfaceIdNamespaceOwnerMap;
52 SurfaceIdNamespaceOwnerMap owner_map_;
53
54 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter);
55 };
56
57 } // namespace content
58
59 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698