| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 RenderWidgetHostImpl* host) | 25 RenderWidgetHostImpl* host) |
| 26 : SyntheticGestureTargetBase(host) { | 26 : SyntheticGestureTargetBase(host) { |
| 27 blink::WebScreenInfo screenInfo; | 27 blink::WebScreenInfo screenInfo; |
| 28 host->GetWebScreenInfo(&screenInfo); | 28 host->GetWebScreenInfo(&screenInfo); |
| 29 device_scale_factor_ = screenInfo.deviceScaleFactor; | 29 device_scale_factor_ = screenInfo.deviceScaleFactor; |
| 30 } | 30 } |
| 31 | 31 |
| 32 void SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform( | 32 void SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform( |
| 33 const WebTouchEvent& web_touch, | 33 const WebTouchEvent& web_touch, |
| 34 const ui::LatencyInfo& latency_info) { | 34 const ui::LatencyInfo& latency_info) { |
| 35 VLOG(0) << "SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform: " |
| 36 << web_touch.type; |
| 35 TouchEventWithLatencyInfo touch_with_latency(web_touch, latency_info); | 37 TouchEventWithLatencyInfo touch_with_latency(web_touch, latency_info); |
| 36 for (size_t i = 0; i < touch_with_latency.event.touchesLength; i++) { | 38 for (size_t i = 0; i < touch_with_latency.event.touchesLength; i++) { |
| 37 touch_with_latency.event.touches[i].position.x *= device_scale_factor_; | 39 touch_with_latency.event.touches[i].position.x *= device_scale_factor_; |
| 38 touch_with_latency.event.touches[i].position.y *= device_scale_factor_; | 40 touch_with_latency.event.touches[i].position.y *= device_scale_factor_; |
| 39 touch_with_latency.event.touches[i].radiusX *= device_scale_factor_; | 41 touch_with_latency.event.touches[i].radiusX *= device_scale_factor_; |
| 40 touch_with_latency.event.touches[i].radiusY *= device_scale_factor_; | 42 touch_with_latency.event.touches[i].radiusY *= device_scale_factor_; |
| 41 } | 43 } |
| 42 ScopedVector<ui::TouchEvent> events; | 44 ScopedVector<ui::TouchEvent> events; |
| 43 bool conversion_success = MakeUITouchEventsFromWebTouchEvents( | 45 bool conversion_success = MakeUITouchEventsFromWebTouchEvents( |
| 44 touch_with_latency, &events, LOCAL_COORDINATES); | 46 touch_with_latency, &events, LOCAL_COORDINATES); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 ->min_distance_for_pinch_scroll_in_pixels(); | 167 ->min_distance_for_pinch_scroll_in_pixels(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 aura::Window* SyntheticGestureTargetAura::GetWindow() const { | 170 aura::Window* SyntheticGestureTargetAura::GetWindow() const { |
| 169 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); | 171 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); |
| 170 DCHECK(window); | 172 DCHECK(window); |
| 171 return window; | 173 return window; |
| 172 } | 174 } |
| 173 | 175 |
| 174 } // namespace content | 176 } // namespace content |
| OLD | NEW |