| 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 "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 9 #include "content/browser/renderer_host/ui_events_helper.h" | 9 #include "content/browser/renderer_host/ui_events_helper.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
| 12 #include "ui/events/event_processor.h" | 12 #include "ui/events/event_processor.h" |
| 13 #include "ui/events/gestures/gesture_configuration.h" | 13 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 14 | 14 |
| 15 using blink::WebTouchEvent; | 15 using blink::WebTouchEvent; |
| 16 using blink::WebMouseWheelEvent; | 16 using blink::WebMouseWheelEvent; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 SyntheticGestureTargetAura::SyntheticGestureTargetAura( | 20 SyntheticGestureTargetAura::SyntheticGestureTargetAura( |
| 21 RenderWidgetHostImpl* host) | 21 RenderWidgetHostImpl* host) |
| 22 : SyntheticGestureTargetBase(host) { | 22 : SyntheticGestureTargetBase(host) { |
| 23 } | 23 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 SyntheticGestureParams::GestureSourceType | 130 SyntheticGestureParams::GestureSourceType |
| 131 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { | 131 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { |
| 132 return SyntheticGestureParams::TOUCH_INPUT; | 132 return SyntheticGestureParams::TOUCH_INPUT; |
| 133 } | 133 } |
| 134 | 134 |
| 135 float SyntheticGestureTargetAura::GetTouchSlopInDips() const { | 135 float SyntheticGestureTargetAura::GetTouchSlopInDips() const { |
| 136 // - 1 because Aura considers a pointer to be moving if it has moved at least | 136 // - 1 because Aura considers a pointer to be moving if it has moved at least |
| 137 // 'max_touch_move_in_pixels_for_click' pixels. | 137 // 'max_touch_move_in_pixels_for_click' pixels. |
| 138 return ui::GestureConfiguration::max_touch_move_in_pixels_for_click() - 1; | 138 return ui::GestureConfiguration::GetInstance() |
| 139 ->max_touch_move_in_pixels_for_click() - |
| 140 1; |
| 139 } | 141 } |
| 140 | 142 |
| 141 float SyntheticGestureTargetAura::GetMinScalingSpanInDips() const { | 143 float SyntheticGestureTargetAura::GetMinScalingSpanInDips() const { |
| 142 return ui::GestureConfiguration::min_distance_for_pinch_scroll_in_pixels(); | 144 return ui::GestureConfiguration::GetInstance() |
| 145 ->min_distance_for_pinch_scroll_in_pixels(); |
| 143 } | 146 } |
| 144 | 147 |
| 145 aura::Window* SyntheticGestureTargetAura::GetWindow() const { | 148 aura::Window* SyntheticGestureTargetAura::GetWindow() const { |
| 146 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); | 149 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); |
| 147 DCHECK(window); | 150 DCHECK(window); |
| 148 return window; | 151 return window; |
| 149 } | 152 } |
| 150 | 153 |
| 151 } // namespace content | 154 } // namespace content |
| OLD | NEW |