 Chromium Code Reviews
 Chromium Code Reviews Issue 1752833002:
  Implement Gesture event hit testing/forwarding for OOPIF.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@wjmCFTouch.v2
    
  
    Issue 1752833002:
  Implement Gesture event hit testing/forwarding for OOPIF.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@wjmCFTouch.v2| 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 | |
| 10 #include <deque> | |
| 9 #include <unordered_map> | 11 #include <unordered_map> | 
| 10 | 12 | 
| 11 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" | 
| 12 #include "base/macros.h" | 14 #include "base/macros.h" | 
| 13 #include "cc/surfaces/surface_hittest_delegate.h" | 15 #include "cc/surfaces/surface_hittest_delegate.h" | 
| 14 #include "cc/surfaces/surface_id.h" | 16 #include "cc/surfaces/surface_id.h" | 
| 15 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h" | 17 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h" | 
| 16 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" | 
| 17 #include "ui/gfx/geometry/vector2d.h" | 19 #include "ui/gfx/geometry/vector2d.h" | 
| 18 | 20 | 
| 19 struct FrameHostMsg_HittestData_Params; | 21 struct FrameHostMsg_HittestData_Params; | 
| 20 | 22 | 
| 21 namespace blink { | 23 namespace blink { | 
| 24 class WebGestureEvent; | |
| 22 class WebMouseEvent; | 25 class WebMouseEvent; | 
| 23 class WebMouseWheelEvent; | 26 class WebMouseWheelEvent; | 
| 24 class WebTouchEvent; | 27 class WebTouchEvent; | 
| 25 } | 28 } | 
| 26 | 29 | 
| 27 namespace gfx { | 30 namespace gfx { | 
| 28 class Point; | 31 class Point; | 
| 29 } | 32 } | 
| 30 | 33 | 
| 31 namespace ui { | 34 namespace ui { | 
| (...skipping 16 matching lines...) Expand all Loading... | |
| 48 RenderWidgetHostInputEventRouter(); | 51 RenderWidgetHostInputEventRouter(); | 
| 49 ~RenderWidgetHostInputEventRouter() final; | 52 ~RenderWidgetHostInputEventRouter() final; | 
| 50 | 53 | 
| 51 void OnRenderWidgetHostViewBaseDestroyed( | 54 void OnRenderWidgetHostViewBaseDestroyed( | 
| 52 RenderWidgetHostViewBase* view) override; | 55 RenderWidgetHostViewBase* view) override; | 
| 53 | 56 | 
| 54 void RouteMouseEvent(RenderWidgetHostViewBase* root_view, | 57 void RouteMouseEvent(RenderWidgetHostViewBase* root_view, | 
| 55 blink::WebMouseEvent* event); | 58 blink::WebMouseEvent* event); | 
| 56 void RouteMouseWheelEvent(RenderWidgetHostViewBase* root_view, | 59 void RouteMouseWheelEvent(RenderWidgetHostViewBase* root_view, | 
| 57 blink::WebMouseWheelEvent* event); | 60 blink::WebMouseWheelEvent* event); | 
| 61 void RouteGestureEvent(RenderWidgetHostViewBase* root_view, | |
| 62 blink::WebGestureEvent* event, | |
| 63 const ui::LatencyInfo& latency); | |
| 58 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, | 64 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, | 
| 59 blink::WebTouchEvent *event, | 65 blink::WebTouchEvent *event, | 
| 60 const ui::LatencyInfo& latency); | 66 const ui::LatencyInfo& latency); | 
| 61 | 67 | 
| 62 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 68 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 
| 63 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | 69 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | 
| 64 | 70 | 
| 65 bool is_registered(uint32_t id) { | 71 bool is_registered(uint32_t id) { | 
| 66 return owner_map_.find(id) != owner_map_.end(); | 72 return owner_map_.find(id) != owner_map_.end(); | 
| 67 } | 73 } | 
| (...skipping 14 matching lines...) Expand all Loading... | |
| 82 const gfx::Point& point_in_quad_space) override; | 88 const gfx::Point& point_in_quad_space) override; | 
| 83 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 89 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 
| 84 const gfx::Point& point_in_quad_space) override; | 90 const gfx::Point& point_in_quad_space) override; | 
| 85 | 91 | 
| 86 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 92 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 
| 87 hittest_data_; | 93 hittest_data_; | 
| 88 }; | 94 }; | 
| 89 | 95 | 
| 90 using SurfaceIdNamespaceOwnerMap = | 96 using SurfaceIdNamespaceOwnerMap = | 
| 91 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; | 97 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; | 
| 98 struct GestureTargetData { | |
| 99 RenderWidgetHostViewBase* target; | |
| 
tdresser
2016/03/02 17:54:43
const?
 
wjmaclean
2016/03/02 18:33:40
No ... this pointer is ultimately used to call a n
 | |
| 100 gfx::Vector2d delta; | |
| 
tdresser
2016/03/02 17:54:43
|delta| needs to be a full transform, doesn't it?
 
tdresser
2016/03/02 17:54:43
const?
 
wjmaclean
2016/03/02 18:33:40
Someday, yes. For this CL, no. We still need to de
 
wjmaclean
2016/03/02 18:33:40
Done.
 | |
| 101 | |
| 102 GestureTargetData(RenderWidgetHostViewBase* target, gfx::Vector2d delta) | |
| 103 : target(target), delta(delta) {} | |
| 104 }; | |
| 105 using GestureTargetQueue = std::deque<GestureTargetData>; | |
| 92 | 106 | 
| 93 void ClearAllObserverRegistrations(); | 107 void ClearAllObserverRegistrations(); | 
| 94 | 108 | 
| 95 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, | 109 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, | 
| 96 const gfx::Point& point, | 110 const gfx::Point& point, | 
| 97 gfx::Point* transformed_point); | 111 gfx::Point* transformed_point); | 
| 98 | 112 | 
| 99 SurfaceIdNamespaceOwnerMap owner_map_; | 113 SurfaceIdNamespaceOwnerMap owner_map_; | 
| 114 GestureTargetQueue gesture_target_queue_; | |
| 100 RenderWidgetHostViewBase* current_touch_target_; | 115 RenderWidgetHostViewBase* current_touch_target_; | 
| 116 RenderWidgetHostViewBase* current_gesture_target_; | |
| 101 gfx::Vector2d touch_delta_; | 117 gfx::Vector2d touch_delta_; | 
| 
tdresser
2016/03/02 17:54:43
touch_sequence_transform_
gesture_sequence_transfo
 
wjmaclean
2016/03/02 18:33:40
Done.
 | |
| 118 gfx::Vector2d gesture_delta_; | |
| 102 int active_touches_; | 119 int active_touches_; | 
| 103 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> | 120 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> | 
| 104 hittest_data_; | 121 hittest_data_; | 
| 105 | 122 | 
| 106 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 123 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 
| 107 }; | 124 }; | 
| 108 | 125 | 
| 109 } // namespace content | 126 } // namespace content | 
| 110 | 127 | 
| 111 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ | 128 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ | 
| OLD | NEW |