| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 blink::WebGestureEvent* event, | 63 blink::WebGestureEvent* event, |
| 64 const ui::LatencyInfo& latency); | 64 const ui::LatencyInfo& latency); |
| 65 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, | 65 void RouteTouchEvent(RenderWidgetHostViewBase* root_view, |
| 66 blink::WebTouchEvent *event, | 66 blink::WebTouchEvent *event, |
| 67 const ui::LatencyInfo& latency); | 67 const ui::LatencyInfo& latency); |
| 68 | 68 |
| 69 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, | 69 void BubbleScrollEvent(RenderWidgetHostViewBase* target_view, |
| 70 const blink::WebGestureEvent& event); | 70 const blink::WebGestureEvent& event); |
| 71 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); | 71 void CancelScrollBubbling(RenderWidgetHostViewBase* target_view); |
| 72 | 72 |
| 73 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 73 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); |
| 74 void RemoveSurfaceIdNamespaceOwner(uint32_t id); | 74 void RemoveSurfaceClientIdOwner(uint32_t id); |
| 75 | 75 |
| 76 bool is_registered(uint32_t id) { | 76 bool is_registered(uint32_t id) { |
| 77 return owner_map_.find(id) != owner_map_.end(); | 77 return owner_map_.find(id) != owner_map_.end(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 80 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 struct HittestData { | 83 struct HittestData { |
| 84 bool ignored_for_hittest; | 84 bool ignored_for_hittest; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class HittestDelegate : public cc::SurfaceHittestDelegate { | 87 class HittestDelegate : public cc::SurfaceHittestDelegate { |
| 88 public: | 88 public: |
| 89 HittestDelegate( | 89 HittestDelegate( |
| 90 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 90 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 91 hittest_data); | 91 hittest_data); |
| 92 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 92 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 93 const gfx::Point& point_in_quad_space) override; | 93 const gfx::Point& point_in_quad_space) override; |
| 94 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, | 94 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, |
| 95 const gfx::Point& point_in_quad_space) override; | 95 const gfx::Point& point_in_quad_space) override; |
| 96 | 96 |
| 97 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 97 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 98 hittest_data_; | 98 hittest_data_; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 using SurfaceIdNamespaceOwnerMap = | 101 using SurfaceClientIdOwnerMap = |
| 102 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; | 102 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; |
| 103 struct TargetData { | 103 struct TargetData { |
| 104 RenderWidgetHostViewBase* target; | 104 RenderWidgetHostViewBase* target; |
| 105 gfx::Vector2d delta; | 105 gfx::Vector2d delta; |
| 106 | 106 |
| 107 TargetData() : target(nullptr) {} | 107 TargetData() : target(nullptr) {} |
| 108 }; | 108 }; |
| 109 using TargetQueue = std::deque<TargetData>; | 109 using TargetQueue = std::deque<TargetData>; |
| 110 | 110 |
| 111 void ClearAllObserverRegistrations(); | 111 void ClearAllObserverRegistrations(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 122 const ui::LatencyInfo& latency); | 122 const ui::LatencyInfo& latency); |
| 123 | 123 |
| 124 // The following methods take a GestureScrollUpdate event and send a | 124 // The following methods take a GestureScrollUpdate event and send a |
| 125 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed | 125 // GestureScrollBegin or GestureScrollEnd for wrapping it. This is needed |
| 126 // when GestureScrollUpdates are being forwarded for scroll bubbling. | 126 // when GestureScrollUpdates are being forwarded for scroll bubbling. |
| 127 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, | 127 void SendGestureScrollBegin(RenderWidgetHostViewBase* view, |
| 128 const blink::WebGestureEvent& event); | 128 const blink::WebGestureEvent& event); |
| 129 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, | 129 void SendGestureScrollEnd(RenderWidgetHostViewBase* view, |
| 130 const blink::WebGestureEvent& event); | 130 const blink::WebGestureEvent& event); |
| 131 | 131 |
| 132 SurfaceIdNamespaceOwnerMap owner_map_; | 132 SurfaceClientIdOwnerMap owner_map_; |
| 133 TargetQueue touchscreen_gesture_target_queue_; | 133 TargetQueue touchscreen_gesture_target_queue_; |
| 134 TargetData touch_target_; | 134 TargetData touch_target_; |
| 135 TargetData touchscreen_gesture_target_; | 135 TargetData touchscreen_gesture_target_; |
| 136 TargetData touchpad_gesture_target_; | 136 TargetData touchpad_gesture_target_; |
| 137 TargetData bubbling_gesture_scroll_target_; | 137 TargetData bubbling_gesture_scroll_target_; |
| 138 TargetData first_bubbling_scroll_target_; | 138 TargetData first_bubbling_scroll_target_; |
| 139 int active_touches_; | 139 int active_touches_; |
| 140 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> | 140 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> |
| 141 hittest_data_; | 141 hittest_data_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 143 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
| 144 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 144 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 145 InputEventRouterGestureTargetQueueTest); | 145 InputEventRouterGestureTargetQueueTest); |
| 146 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 146 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 147 InputEventRouterTouchpadGestureTargetTest); | 147 InputEventRouterTouchpadGestureTargetTest); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace content | 150 } // namespace content |
| 151 | 151 |
| 152 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 152 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
| OLD | NEW |