OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" | 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
11 #include "content/browser/renderer_host/ui_events_helper.h" | 11 #include "content/browser/renderer_host/ui_events_helper.h" |
12 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 12 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/aura/window_event_dispatcher.h" | |
14 #include "ui/aura/window_tree_host.h" | 15 #include "ui/aura/window_tree_host.h" |
15 #include "ui/events/event_processor.h" | 16 #include "ui/events/event_processor.h" |
16 #include "ui/events/event_utils.h" | 17 #include "ui/events/event_utils.h" |
17 #include "ui/events/gesture_detection/gesture_configuration.h" | 18 #include "ui/events/gesture_detection/gesture_configuration.h" |
18 | 19 |
19 using blink::WebTouchEvent; | 20 using blink::WebTouchEvent; |
20 using blink::WebMouseWheelEvent; | 21 using blink::WebMouseWheelEvent; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
(...skipping 10 matching lines...) Expand all Loading... | |
34 const ui::LatencyInfo& latency_info) { | 35 const ui::LatencyInfo& latency_info) { |
35 TouchEventWithLatencyInfo touch_with_latency(web_touch, latency_info); | 36 TouchEventWithLatencyInfo touch_with_latency(web_touch, latency_info); |
36 for (size_t i = 0; i < touch_with_latency.event.touchesLength; i++) { | 37 for (size_t i = 0; i < touch_with_latency.event.touchesLength; i++) { |
37 touch_with_latency.event.touches[i].position.x *= device_scale_factor_; | 38 touch_with_latency.event.touches[i].position.x *= device_scale_factor_; |
38 touch_with_latency.event.touches[i].position.y *= device_scale_factor_; | 39 touch_with_latency.event.touches[i].position.y *= device_scale_factor_; |
39 touch_with_latency.event.touches[i].radiusX *= device_scale_factor_; | 40 touch_with_latency.event.touches[i].radiusX *= device_scale_factor_; |
40 touch_with_latency.event.touches[i].radiusY *= device_scale_factor_; | 41 touch_with_latency.event.touches[i].radiusY *= device_scale_factor_; |
41 } | 42 } |
42 ScopedVector<ui::TouchEvent> events; | 43 ScopedVector<ui::TouchEvent> events; |
43 bool conversion_success = MakeUITouchEventsFromWebTouchEvents( | 44 bool conversion_success = MakeUITouchEventsFromWebTouchEvents( |
44 touch_with_latency, &events, LOCAL_COORDINATES); | 45 touch_with_latency, &events, LOCAL_COORDINATES); |
tdresser
2016/08/22 12:52:39
Should we just be constructing these in a differen
lanwei
2016/08/24 11:56:06
Done.
tdresser
2016/08/24 12:27:48
Are you sure SCREEN_COORDINATES is correct?
I was
| |
45 DCHECK(conversion_success); | 46 DCHECK(conversion_success); |
46 | 47 |
47 aura::Window* window = GetWindow(); | 48 aura::Window* window = GetWindow(); |
48 aura::WindowTreeHost* host = window->GetHost(); | 49 aura::WindowTreeHost* host = window->GetHost(); |
50 host->dispatcher()->set_transform_events(false); | |
51 | |
49 for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(), | 52 for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(), |
50 end = events.end(); iter != end; ++iter) { | 53 end = events.end(); iter != end; ++iter) { |
51 (*iter)->ConvertLocationToTarget(window, host->window()); | 54 (*iter)->ConvertLocationToTarget(window, host->window()); |
52 ui::EventDispatchDetails details = | 55 ui::EventDispatchDetails details = |
53 host->event_processor()->OnEventFromSource(*iter); | 56 host->event_processor()->OnEventFromSource(*iter); |
54 if (details.dispatcher_destroyed) | 57 if (details.dispatcher_destroyed) |
55 break; | 58 break; |
56 } | 59 } |
57 } | 60 } |
58 | 61 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 ->min_distance_for_pinch_scroll_in_pixels(); | 168 ->min_distance_for_pinch_scroll_in_pixels(); |
166 } | 169 } |
167 | 170 |
168 aura::Window* SyntheticGestureTargetAura::GetWindow() const { | 171 aura::Window* SyntheticGestureTargetAura::GetWindow() const { |
169 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); | 172 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); |
170 DCHECK(window); | 173 DCHECK(window); |
171 return window; | 174 return window; |
172 } | 175 } |
173 | 176 |
174 } // namespace content | 177 } // namespace content |
OLD | NEW |