| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/chromeos/touch_exploration_controller.h" | 5 #include "ui/chromeos/touch_exploration_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 // the ChromeVox content script to process touch exploration events, but | 1065 // the ChromeVox content script to process touch exploration events, but |
| 1066 // ChromeVox needs a way to distinguish between a real mouse move and a | 1066 // ChromeVox needs a way to distinguish between a real mouse move and a |
| 1067 // mouse move generated from touch exploration, so we have touch exploration | 1067 // mouse move generated from touch exploration, so we have touch exploration |
| 1068 // pretend that the command key was down (which becomes the "meta" key in | 1068 // pretend that the command key was down (which becomes the "meta" key in |
| 1069 // JavaScript). We can remove this hack when the ChromeVox content script | 1069 // JavaScript). We can remove this hack when the ChromeVox content script |
| 1070 // goes away and native accessibility code sends a touch exploration | 1070 // goes away and native accessibility code sends a touch exploration |
| 1071 // event to the new ChromeVox background page via the automation api. | 1071 // event to the new ChromeVox background page via the automation api. |
| 1072 flags |= ui::EF_COMMAND_DOWN; | 1072 flags |= ui::EF_COMMAND_DOWN; |
| 1073 | 1073 |
| 1074 std::unique_ptr<ui::MouseEvent> event(new ui::MouseEvent( | 1074 std::unique_ptr<ui::MouseEvent> event(new ui::MouseEvent( |
| 1075 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), Now(), flags, 0)); | 1075 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), Now(), flags, 0, |
| 1076 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
| 1077 ui::PointerEvent::kMousePointerId))); |
| 1076 event->set_location_f(location); | 1078 event->set_location_f(location); |
| 1077 event->set_root_location_f(location); | 1079 event->set_root_location_f(location); |
| 1078 return event; | 1080 return event; |
| 1079 } | 1081 } |
| 1080 | 1082 |
| 1081 void TouchExplorationController::EnterTouchToMouseMode() { | 1083 void TouchExplorationController::EnterTouchToMouseMode() { |
| 1082 aura::client::CursorClient* cursor_client = | 1084 aura::client::CursorClient* cursor_client = |
| 1083 aura::client::GetCursorClient(root_window_); | 1085 aura::client::GetCursorClient(root_window_); |
| 1084 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) | 1086 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) |
| 1085 cursor_client->EnableMouseEvents(); | 1087 cursor_client->EnableMouseEvents(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 return "TWO_FINGER_TAP"; | 1194 return "TWO_FINGER_TAP"; |
| 1193 } | 1195 } |
| 1194 return "Not a state"; | 1196 return "Not a state"; |
| 1195 } | 1197 } |
| 1196 | 1198 |
| 1197 float TouchExplorationController::GetSplitTapTouchSlop() { | 1199 float TouchExplorationController::GetSplitTapTouchSlop() { |
| 1198 return gesture_detector_config_.touch_slop * 3; | 1200 return gesture_detector_config_.touch_slop * 3; |
| 1199 } | 1201 } |
| 1200 | 1202 |
| 1201 } // namespace ui | 1203 } // namespace ui |
| OLD | NEW |