| 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 <deque> | 10 #include <deque> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 blink::WebGestureEvent* event, | 66 blink::WebGestureEvent* event, |
| 67 const ui::LatencyInfo& latency); | 67 const ui::LatencyInfo& latency); |
| 68 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, | 68 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, |
| 69 blink::WebTouchEvent *event, | 69 blink::WebTouchEvent *event, |
| 70 const ui::LatencyInfo& latency); | 70 const ui::LatencyInfo& latency); |
| 71 | 71 |
| 72 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, | 72 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, |
| 73 const blink::WebGestureEvent& event); | 73 const blink::WebGestureEvent& event); |
| 74 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); | 74 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); |
| 75 | 75 |
| 76 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 76 void AddFrameSinkIdOwner(const cc::FrameSinkId& id, |
| 77 void RemoveSurfaceClientIdOwner(uint32_t id); | 77 RenderWidgetHostViewBase* owner); |
| 78 void RemoveFrameSinkIdOwner(const cc::FrameSinkId& id); |
| 78 | 79 |
| 79 bool is_registered(uint32_t id) { | 80 bool is_registered(const cc::FrameSinkId& id) { |
| 80 return owner_map_.find(id) != owner_map_.end(); | 81 return owner_map_.find(id) != owner_map_.end(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 84 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 84 | 85 |
| 85 // Returns the RenderWidgetHostImpl inside the |root_view| at |point| where | 86 // Returns the RenderWidgetHostImpl inside the |root_view| at |point| where |
| 86 // |point| is with respect to |root_view|'s coordinates. If a RWHI is found, | 87 // |point| is with respect to |root_view|'s coordinates. If a RWHI is found, |
| 87 // the value of |transformed_point| is the coordinate of the point with | 88 // the value of |transformed_point| is the coordinate of the point with |
| 88 // respect to the RWHI's coordinates. | 89 // respect to the RWHI's coordinates. |
| 89 RenderWidgetHostImpl* GetRenderWidgetHostAtPoint( | 90 RenderWidgetHostImpl* GetRenderWidgetHostAtPoint( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 103 hittest_data); | 104 hittest_data); |
| 104 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 105 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 105 const gfx::Point& point_in_quad_space) override; | 106 const gfx::Point& point_in_quad_space) override; |
| 106 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 107 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 107 const gfx::Point& point_in_quad_space) override; | 108 const gfx::Point& point_in_quad_space) override; |
| 108 | 109 |
| 109 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 110 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 110 hittest_data_; | 111 hittest_data_; |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 using SurfaceClientIdOwnerMap = | 114 using FrameSinkIdOwnerMap = std::unordered_map<cc::FrameSinkId, |
| 114 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; | 115 RenderWidgetHostViewBase*, |
| 116 cc::FrameSinkIdHash>; |
| 115 struct TargetData { | 117 struct TargetData { |
| 116 RenderWidgetHostViewBase* target; | 118 RenderWidgetHostViewBase* target; |
| 117 gfx::Vector2d delta; | 119 gfx::Vector2d delta; |
| 118 | 120 |
| 119 TargetData() : target(nullptr) {} | 121 TargetData() : target(nullptr) {} |
| 120 }; | 122 }; |
| 121 using TargetQueue = std::deque<TargetData>; | 123 using TargetQueue = std::deque<TargetData>; |
| 122 | 124 |
| 123 void ClearAllObserverRegistrations(); | 125 void ClearAllObserverRegistrations(); |
| 124 | 126 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 143 RenderWidgetHostViewBase* root_view); | 145 RenderWidgetHostViewBase* root_view); |
| 144 | 146 |
| 145 // The following methods take a GestureScrollUpdate event and send a | 147 // The following methods take a GestureScrollUpdate event and send a |
| 146 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed | 148 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed |
| 147 // when GestureScrollUpdates are being forwarded for scroll bubbling. | 149 // when GestureScrollUpdates are being forwarded for scroll bubbling. |
| 148 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, | 150 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, |
| 149 const blink::WebGestureEvent& event); | 151 const blink::WebGestureEvent& event); |
| 150 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, | 152 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, |
| 151 const blink::WebGestureEvent& event); | 153 const blink::WebGestureEvent& event); |
| 152 | 154 |
| 153 SurfaceClientIdOwnerMap owner_map_; | 155 FrameSinkIdOwnerMap owner_map_; |
| 154 TargetQueue touchscreen_gesture_target_queue_; | 156 TargetQueue touchscreen_gesture_target_queue_; |
| 155 TargetData touch_target_; | 157 TargetData touch_target_; |
| 156 TargetData touchscreen_gesture_target_; | 158 TargetData touchscreen_gesture_target_; |
| 157 TargetData touchpad_gesture_target_; | 159 TargetData touchpad_gesture_target_; |
| 158 TargetData bubbling_gesture_scroll_target_; | 160 TargetData bubbling_gesture_scroll_target_; |
| 159 TargetData first_bubbling_scroll_target_; | 161 TargetData first_bubbling_scroll_target_; |
| 160 // Maintains the same target between mouse down and mouse up. | 162 // Maintains the same target between mouse down and mouse up. |
| 161 TargetData mouse_capture_target_; | 163 TargetData mouse_capture_target_; |
| 162 | 164 |
| 163 // Tracked for the purpose of generating MouseEnter and MouseLeave events. | 165 // Tracked for the purpose of generating MouseEnter and MouseLeave events. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 176 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 178 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
| 177 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 179 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 178 InputEventRouterGestureTargetQueueTest); | 180 InputEventRouterGestureTargetQueueTest); |
| 179 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 181 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 180 InputEventRouterTouchpadGestureTargetTest); | 182 InputEventRouterTouchpadGestureTargetTest); |
| 181 }; | 183 }; |
| 182 | 184 |
| 183 } // namespace content | 185 } // namespace content |
| 184 | 186 |
| 185 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 187 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
| OLD | NEW |