OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ | 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_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <unordered_map> |
9 | 10 |
10 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "cc/surfaces/surface_hittest_delegate.h" |
| 15 #include "cc/surfaces/surface_id.h" |
13 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
14 | 17 |
| 18 struct FrameHostMsg_HittestData_Params; |
| 19 |
15 namespace blink { | 20 namespace blink { |
16 class WebMouseEvent; | 21 class WebMouseEvent; |
17 class WebMouseWheelEvent; | 22 class WebMouseWheelEvent; |
18 class WebTouchEvent; | 23 class WebTouchEvent; |
19 } | 24 } |
20 | 25 |
21 namespace gfx { | 26 namespace gfx { |
22 class Point; | 27 class Point; |
23 } | 28 } |
24 | 29 |
(...skipping 24 matching lines...) Expand all Loading... |
49 blink::WebTouchEvent *event, | 54 blink::WebTouchEvent *event, |
50 const ui::LatencyInfo& latency); | 55 const ui::LatencyInfo& latency); |
51 | 56 |
52 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 57 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); |
53 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | 58 void RemoveSurfaceIdNamespaceOwner(uint32_t id); |
54 | 59 |
55 bool is_registered(uint32_t id) { | 60 bool is_registered(uint32_t id) { |
56 return owner_map_.find(id) != owner_map_.end(); | 61 return owner_map_.find(id) != owner_map_.end(); |
57 } | 62 } |
58 | 63 |
| 64 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 65 |
59 private: | 66 private: |
| 67 struct HittestData { |
| 68 bool ignored_for_hittest; |
| 69 }; |
| 70 |
| 71 class HittestDelegate : public cc::SurfaceHittestDelegate { |
| 72 public: |
| 73 HittestDelegate( |
| 74 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 75 hittest_data); |
| 76 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 77 const gfx::Point& point_in_quad_space) override; |
| 78 |
| 79 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 80 hittest_data_; |
| 81 }; |
| 82 |
60 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>; | 83 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>; |
61 using SurfaceIdNamespaceOwnerMap = | 84 using SurfaceIdNamespaceOwnerMap = |
62 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>; | 85 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>; |
63 | 86 |
64 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, | 87 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, |
65 const gfx::Point& point, | 88 const gfx::Point& point, |
66 gfx::Point* transformed_point); | 89 gfx::Point* transformed_point); |
67 | 90 |
68 SurfaceIdNamespaceOwnerMap owner_map_; | 91 SurfaceIdNamespaceOwnerMap owner_map_; |
69 WeakTarget current_touch_target_; | 92 WeakTarget current_touch_target_; |
70 int active_touches_; | 93 int active_touches_; |
| 94 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> |
| 95 hittest_data_; |
71 | 96 |
72 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 97 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
73 }; | 98 }; |
74 | 99 |
75 } // namespace content | 100 } // namespace content |
76 | 101 |
77 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 102 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
OLD | NEW |