| 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/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 ui::MouseEvent mouse_event(event_type, location, location, flags, flags); | 141 ui::MouseEvent mouse_event(event_type, location, location, flags, flags); |
| 142 | 142 |
| 143 ui::EventDispatchDetails details = | 143 ui::EventDispatchDetails details = |
| 144 GetWindowEventDispatcher()->OnEventFromSource(&mouse_event); | 144 GetWindowEventDispatcher()->OnEventFromSource(&mouse_event); |
| 145 if (details.dispatcher_destroyed) | 145 if (details.dispatcher_destroyed) |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 SyntheticGestureParams::GestureSourceType | 149 SyntheticGestureParams::GestureSourceType |
| 150 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { | 150 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { |
| 151 return SyntheticGestureParams::MOUSE_INPUT; | 151 return SyntheticGestureParams::TOUCH_INPUT; |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool SyntheticGestureTargetAura::SupportsSyntheticGestureSourceType( | 154 bool SyntheticGestureTargetAura::SupportsSyntheticGestureSourceType( |
| 155 SyntheticGestureParams::GestureSourceType gesture_source_type) const { | 155 SyntheticGestureParams::GestureSourceType gesture_source_type) const { |
| 156 return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT || | 156 return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT || |
| 157 gesture_source_type == SyntheticGestureParams::MOUSE_INPUT; | 157 gesture_source_type == SyntheticGestureParams::MOUSE_INPUT; |
| 158 } | 158 } |
| 159 | 159 |
| 160 int SyntheticGestureTargetAura::GetTouchSlopInDips() const { | 160 int SyntheticGestureTargetAura::GetTouchSlopInDips() const { |
| 161 // - 1 because Aura considers a pointer to be moving if it has moved at least | 161 // - 1 because Aura considers a pointer to be moving if it has moved at least |
| (...skipping 17 matching lines...) Expand all Loading... |
| 179 aura::client::ScreenPositionClient* | 179 aura::client::ScreenPositionClient* |
| 180 SyntheticGestureTargetAura::GetScreenPositionClient() const { | 180 SyntheticGestureTargetAura::GetScreenPositionClient() const { |
| 181 aura::Window* root_window = GetWindow()->GetRootWindow(); | 181 aura::Window* root_window = GetWindow()->GetRootWindow(); |
| 182 aura::client::ScreenPositionClient* position_client = | 182 aura::client::ScreenPositionClient* position_client = |
| 183 aura::client::GetScreenPositionClient(root_window); | 183 aura::client::GetScreenPositionClient(root_window); |
| 184 DCHECK(position_client); | 184 DCHECK(position_client); |
| 185 return position_client; | 185 return position_client; |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace content | 188 } // namespace content |
| OLD | NEW |