| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 // the ChromeVox content script to process touch exploration events, but | 980 // the ChromeVox content script to process touch exploration events, but |
| 981 // ChromeVox needs a way to distinguish between a real mouse move and a | 981 // ChromeVox needs a way to distinguish between a real mouse move and a |
| 982 // mouse move generated from touch exploration, so we have touch exploration | 982 // mouse move generated from touch exploration, so we have touch exploration |
| 983 // pretend that the command key was down (which becomes the "meta" key in | 983 // pretend that the command key was down (which becomes the "meta" key in |
| 984 // JavaScript). We can remove this hack when the ChromeVox content script | 984 // JavaScript). We can remove this hack when the ChromeVox content script |
| 985 // goes away and native accessibility code sends a touch exploration | 985 // goes away and native accessibility code sends a touch exploration |
| 986 // event to the new ChromeVox background page via the automation api. | 986 // event to the new ChromeVox background page via the automation api. |
| 987 flags |= ui::EF_COMMAND_DOWN; | 987 flags |= ui::EF_COMMAND_DOWN; |
| 988 | 988 |
| 989 return make_scoped_ptr(new ui::MouseEvent( | 989 return make_scoped_ptr(new ui::MouseEvent( |
| 990 ui::ET_MOUSE_MOVED, location, location, ui::EventTimeForNow(), flags, 0)); | 990 ui::ET_MOUSE_MOVED, location, location, ui::EventTimeForNow(), flags, 0, |
| 991 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 991 } | 992 } |
| 992 | 993 |
| 993 void TouchExplorationController::EnterTouchToMouseMode() { | 994 void TouchExplorationController::EnterTouchToMouseMode() { |
| 994 aura::client::CursorClient* cursor_client = | 995 aura::client::CursorClient* cursor_client = |
| 995 aura::client::GetCursorClient(root_window_); | 996 aura::client::GetCursorClient(root_window_); |
| 996 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) | 997 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) |
| 997 cursor_client->EnableMouseEvents(); | 998 cursor_client->EnableMouseEvents(); |
| 998 if (cursor_client && cursor_client->IsCursorVisible()) | 999 if (cursor_client && cursor_client->IsCursorVisible()) |
| 999 cursor_client->HideCursor(); | 1000 cursor_client->HideCursor(); |
| 1000 } | 1001 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 up_swipe_gestures_[4] = BindKeyEventWithFlags(VKEY_BROWSER_HOME, ui::EF_NONE); | 1151 up_swipe_gestures_[4] = BindKeyEventWithFlags(VKEY_BROWSER_HOME, ui::EF_NONE); |
| 1151 down_swipe_gestures_[4] = | 1152 down_swipe_gestures_[4] = |
| 1152 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE); | 1153 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE); |
| 1153 } | 1154 } |
| 1154 | 1155 |
| 1155 float TouchExplorationController::GetSplitTapTouchSlop() { | 1156 float TouchExplorationController::GetSplitTapTouchSlop() { |
| 1156 return gesture_detector_config_.touch_slop * 3; | 1157 return gesture_detector_config_.touch_slop * 3; |
| 1157 } | 1158 } |
| 1158 | 1159 |
| 1159 } // namespace ui | 1160 } // namespace ui |
| OLD | NEW |