Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: content/browser/renderer_host/render_widget_host_input_event_router.h

Issue 2034213002: Reland: Fix touchpad gesture routing to renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Windows failure Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const gfx::Point& point_in_quad_space) override; 89 const gfx::Point& point_in_quad_space) override;
90 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad, 90 bool AcceptHitTarget(const cc::SurfaceDrawQuad* surface_quad,
91 const gfx::Point& point_in_quad_space) override; 91 const gfx::Point& point_in_quad_space) override;
92 92
93 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& 93 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>&
94 hittest_data_; 94 hittest_data_;
95 }; 95 };
96 96
97 using SurfaceIdNamespaceOwnerMap = 97 using SurfaceIdNamespaceOwnerMap =
98 base::hash_map<uint32_t, RenderWidgetHostViewBase*>; 98 base::hash_map<uint32_t, RenderWidgetHostViewBase*>;
99 struct GestureTargetData { 99 struct TargetData {
100 RenderWidgetHostViewBase* target; 100 RenderWidgetHostViewBase* target;
101 const gfx::Vector2d delta; 101 gfx::Vector2d delta;
102 102
103 GestureTargetData(RenderWidgetHostViewBase* target, gfx::Vector2d delta) 103 TargetData() : target(nullptr) {}
104 : target(target), delta(delta) {}
105 }; 104 };
106 using GestureTargetQueue = std::deque<GestureTargetData>; 105 using TargetQueue = std::deque<TargetData>;
107 106
108 void ClearAllObserverRegistrations(); 107 void ClearAllObserverRegistrations();
109 108
110 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, 109 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view,
111 const gfx::Point& point, 110 const gfx::Point& point,
112 gfx::Point* transformed_point); 111 gfx::Point* transformed_point);
113 112
113 void RouteTouchscreenGestureEvent(RenderWidgetHostViewBase* root_view,
114 blink::WebGestureEvent* event,
115 const ui::LatencyInfo& latency);
116 void RouteTouchpadGestureEvent(RenderWidgetHostViewBase* root_view,
117 blink::WebGestureEvent* event,
118 const ui::LatencyInfo& latency);
119
114 SurfaceIdNamespaceOwnerMap owner_map_; 120 SurfaceIdNamespaceOwnerMap owner_map_;
115 GestureTargetQueue gesture_target_queue_; 121 TargetQueue touchscreen_gesture_target_queue_;
116 RenderWidgetHostViewBase* touch_target_; 122 TargetData touch_target_;
117 RenderWidgetHostViewBase* gesture_target_; 123 TargetData touchscreen_gesture_target_;
118 gfx::Vector2d touch_delta_; 124 TargetData touchpad_gesture_target_;
119 gfx::Vector2d gesture_delta_;
120 int active_touches_; 125 int active_touches_;
121 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> 126 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>
122 hittest_data_; 127 hittest_data_;
123 128
124 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); 129 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter);
125 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, 130 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
126 InputEventRouterGestureTargetQueueTest); 131 InputEventRouterGestureTargetQueueTest);
132 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
133 InputEventRouterTouchpadGestureTargetTest);
127 }; 134 };
128 135
129 } // namespace content 136 } // namespace content
130 137
131 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ 138 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698