| 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 "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/accessibility_types.h" | 8 #include "ash/common/accessibility_types.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 root_window_->AddPreTargetHandler(event_handler_.get()); | 51 root_window_->AddPreTargetHandler(event_handler_.get()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void TearDownOnMainThread() override { | 54 void TearDownOnMainThread() override { |
| 55 SwitchTouchExplorationMode(false); | 55 SwitchTouchExplorationMode(false); |
| 56 root_window_->RemovePreTargetHandler(event_handler_.get()); | 56 root_window_->RemovePreTargetHandler(event_handler_.get()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SwitchTouchExplorationMode(bool on) { | 59 void SwitchTouchExplorationMode(bool on) { |
| 60 ash::AccessibilityDelegate* delegate = | 60 ash::AccessibilityDelegate* delegate = |
| 61 ash::WmShell::Get()->accessibility_delegate(); | 61 ash::Shell::GetInstance()->accessibility_delegate(); |
| 62 if (on != delegate->IsSpokenFeedbackEnabled()) | 62 if (on != delegate->IsSpokenFeedbackEnabled()) |
| 63 delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); | 63 delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); |
| 64 } | 64 } |
| 65 | 65 |
| 66 base::TimeTicks Now() { return simulated_clock_->NowTicks(); } | 66 base::TimeTicks Now() { return simulated_clock_->NowTicks(); } |
| 67 | 67 |
| 68 ui::GestureDetector::Config gesture_detector_config_; | 68 ui::GestureDetector::Config gesture_detector_config_; |
| 69 base::SimpleTestTickClock* simulated_clock_; | 69 base::SimpleTestTickClock* simulated_clock_; |
| 70 aura::Window* root_window_; | 70 aura::Window* root_window_; |
| 71 std::unique_ptr<ui::test::TestEventHandler> event_handler_; | 71 std::unique_ptr<ui::test::TestEventHandler> event_handler_; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 EXPECT_EQ(2, event_handler_->num_touch_events()); | 240 EXPECT_EQ(2, event_handler_->num_touch_events()); |
| 241 event_handler_->Reset(); | 241 event_handler_->Reset(); |
| 242 | 242 |
| 243 // Continuing to move the touch exploration finger should send more mouse | 243 // Continuing to move the touch exploration finger should send more mouse |
| 244 // events. | 244 // events. |
| 245 generator.MoveTouchId(gfx::Point(509, 609), 1); | 245 generator.MoveTouchId(gfx::Point(509, 609), 1); |
| 246 EXPECT_EQ(0, event_handler_->num_touch_events()); | 246 EXPECT_EQ(0, event_handler_->num_touch_events()); |
| 247 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); | 247 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); |
| 248 EXPECT_FALSE(cursor_client->IsCursorVisible()); | 248 EXPECT_FALSE(cursor_client->IsCursorVisible()); |
| 249 } | 249 } |
| OLD | NEW |