| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 blink::WebGestureEvent* event, | 65 blink::WebGestureEvent* event, |
| 66 const ui::LatencyInfo& latency); | 66 const ui::LatencyInfo& latency); |
| 67 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, | 67 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, |
| 68 blink::WebTouchEvent *event, | 68 blink::WebTouchEvent *event, |
| 69 const ui::LatencyInfo& latency); | 69 const ui::LatencyInfo& latency); |
| 70 | 70 |
| 71 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, | 71 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, |
| 72 const blink::WebGestureEvent& event); | 72 const blink::WebGestureEvent& event); |
| 73 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); | 73 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); |
| 74 | 74 |
| 75 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 75 void AddFrameSinkIdOwner(const cc::FrameSinkId& id, |
| 76 void RemoveSurfaceClientIdOwner(uint32_t id); | 76 RenderWidgetHostViewBase* owner); |
| 77 void RemoveFrameSinkIdOwner(const cc::FrameSinkId& id); |
| 77 | 78 |
| 78 bool is_registered(uint32_t id) { | 79 bool is_registered(const cc::FrameSinkId& id) { |
| 79 return owner_map_.find(id) != owner_map_.end(); | 80 return owner_map_.find(id) != owner_map_.end(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 83 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 83 | 84 |
| 84 private: | 85 private: |
| 85 struct HittestData { | 86 struct HittestData { |
| 86 bool ignored_for_hittest; | 87 bool ignored_for_hittest; |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 class HittestDelegate : public cc::SurfaceHittestDelegate { | 90 class HittestDelegate : public cc::SurfaceHittestDelegate { |
| 90 public: | 91 public: |
| 91 HittestDelegate( | 92 HittestDelegate( |
| 92 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 93 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 93 hittest_data); | 94 hittest_data); |
| 94 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 95 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 95 const gfx::Point& point_in_quad_space) override; | 96 const gfx::Point& point_in_quad_space) override; |
| 96 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 97 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 97 const gfx::Point& point_in_quad_space) override; | 98 const gfx::Point& point_in_quad_space) override; |
| 98 | 99 |
| 99 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 100 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 100 hittest_data_; | 101 hittest_data_; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 using SurfaceClientIdOwnerMap = | 104 using FrameSinkIdOwnerMap = std::unordered_map<cc::FrameSinkId, |
| 104 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; | 105 RenderWidgetHostViewBase*, |
| 106 cc::FrameSinkIdHash>; |
| 105 struct TargetData { | 107 struct TargetData { |
| 106 RenderWidgetHostViewBase* target; | 108 RenderWidgetHostViewBase* target; |
| 107 gfx::Vector2d delta; | 109 gfx::Vector2d delta; |
| 108 | 110 |
| 109 TargetData() : target(nullptr) {} | 111 TargetData() : target(nullptr) {} |
| 110 }; | 112 }; |
| 111 using TargetQueue = std::deque<TargetData>; | 113 using TargetQueue = std::deque<TargetData>; |
| 112 | 114 |
| 113 void ClearAllObserverRegistrations(); | 115 void ClearAllObserverRegistrations(); |
| 114 | 116 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 133 RenderWidgetHostViewBase* root_view); | 135 RenderWidgetHostViewBase* root_view); |
| 134 | 136 |
| 135 // The following methods take a GestureScrollUpdate event and send a | 137 // The following methods take a GestureScrollUpdate event and send a |
| 136 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed | 138 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed |
| 137 // when GestureScrollUpdates are being forwarded for scroll bubbling. | 139 // when GestureScrollUpdates are being forwarded for scroll bubbling. |
| 138 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, | 140 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, |
| 139 const blink::WebGestureEvent& event); | 141 const blink::WebGestureEvent& event); |
| 140 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, | 142 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, |
| 141 const blink::WebGestureEvent& event); | 143 const blink::WebGestureEvent& event); |
| 142 | 144 |
| 143 SurfaceClientIdOwnerMap owner_map_; | 145 FrameSinkIdOwnerMap owner_map_; |
| 144 TargetQueue touchscreen_gesture_target_queue_; | 146 TargetQueue touchscreen_gesture_target_queue_; |
| 145 TargetData touch_target_; | 147 TargetData touch_target_; |
| 146 TargetData touchscreen_gesture_target_; | 148 TargetData touchscreen_gesture_target_; |
| 147 TargetData touchpad_gesture_target_; | 149 TargetData touchpad_gesture_target_; |
| 148 TargetData bubbling_gesture_scroll_target_; | 150 TargetData bubbling_gesture_scroll_target_; |
| 149 TargetData first_bubbling_scroll_target_; | 151 TargetData first_bubbling_scroll_target_; |
| 150 // Maintains the same target between mouse down and mouse up. | 152 // Maintains the same target between mouse down and mouse up. |
| 151 TargetData mouse_capture_target_; | 153 TargetData mouse_capture_target_; |
| 152 | 154 |
| 153 // Tracked for the purpose of generating MouseEnter and MouseLeave events. | 155 // Tracked for the purpose of generating MouseEnter and MouseLeave events. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 166 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 168 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
| 167 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 169 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 168 InputEventRouterGestureTargetQueueTest); | 170 InputEventRouterGestureTargetQueueTest); |
| 169 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 171 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 170 InputEventRouterTouchpadGestureTargetTest); | 172 InputEventRouterTouchpadGestureTargetTest); |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 } // namespace content | 175 } // namespace content |
| 174 | 176 |
| 175 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 177 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
| OLD | NEW |