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 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/memory/weak_ptr.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 class WebMouseEvent; | 15 class WebMouseEvent; |
15 class WebMouseWheelEvent; | 16 class WebMouseWheelEvent; |
16 class WebTouchEvent; | 17 class WebTouchEvent; |
17 } | 18 } |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 class Point; | 21 class Point; |
(...skipping 27 matching lines...) Expand all Loading... |
48 const ui::LatencyInfo& latency); | 49 const ui::LatencyInfo& latency); |
49 | 50 |
50 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 51 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); |
51 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | 52 void RemoveSurfaceIdNamespaceOwner(uint32_t id); |
52 | 53 |
53 bool is_registered(uint32_t id) { | 54 bool is_registered(uint32_t id) { |
54 return owner_map_.find(id) != owner_map_.end(); | 55 return owner_map_.find(id) != owner_map_.end(); |
55 } | 56 } |
56 | 57 |
57 private: | 58 private: |
58 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, | 59 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>; |
59 const gfx::Point& point, | 60 using SurfaceIdNamespaceOwnerMap = base::hash_map<uint32_t, WeakTarget>; |
60 gfx::Point* transformed_point); | |
61 | 61 |
62 typedef base::hash_map<uint32_t, RenderWidgetHostViewBase*> | 62 WeakTarget FindEventTarget(RenderWidgetHostViewBase* root_view, |
63 SurfaceIdNamespaceOwnerMap; | 63 const gfx::Point& point, |
| 64 gfx::Point* transformed_point); |
| 65 |
64 SurfaceIdNamespaceOwnerMap owner_map_; | 66 SurfaceIdNamespaceOwnerMap owner_map_; |
65 RenderWidgetHostViewBase* current_touch_target_; | 67 bool has_current_touch_target_; |
| 68 WeakTarget current_touch_target_; |
66 int active_touches_; | 69 int active_touches_; |
67 | 70 |
68 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 71 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
69 }; | 72 }; |
70 | 73 |
71 } // namespace content | 74 } // namespace content |
72 | 75 |
73 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 76 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
OLD | NEW |