| 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 <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 void SuppressVLOGs(bool suppress) { | 291 void SuppressVLOGs(bool suppress) { |
| 292 touch_exploration_controller_->SuppressVLOGsForTesting(suppress); | 292 touch_exploration_controller_->SuppressVLOGsForTesting(suppress); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void SwitchTouchExplorationMode(bool on) { | 295 void SwitchTouchExplorationMode(bool on) { |
| 296 if (!on && touch_exploration_controller_.get()) { | 296 if (!on && touch_exploration_controller_.get()) { |
| 297 touch_exploration_controller_.reset(); | 297 touch_exploration_controller_.reset(); |
| 298 } else if (on && !touch_exploration_controller_.get()) { | 298 } else if (on && !touch_exploration_controller_.get()) { |
| 299 touch_exploration_controller_.reset( | 299 touch_exploration_controller_.reset( |
| 300 new ui::TouchExplorationControllerTestApi( | 300 new ui::TouchExplorationControllerTestApi( |
| 301 new TouchExplorationController(root_window(), &delegate_, | 301 new TouchExplorationController(root_window(), &delegate_))); |
| 302 nullptr))); | |
| 303 cursor_client()->ShowCursor(); | 302 cursor_client()->ShowCursor(); |
| 304 cursor_client()->DisableMouseEvents(); | 303 cursor_client()->DisableMouseEvents(); |
| 305 } | 304 } |
| 306 } | 305 } |
| 307 | 306 |
| 308 void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) { | 307 void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) { |
| 309 ui::TouchEvent touch_press(ui::ET_TOUCH_PRESSED, tap_location, 0, Now()); | 308 ui::TouchEvent touch_press(ui::ET_TOUCH_PRESSED, tap_location, 0, Now()); |
| 310 generator_->Dispatch(&touch_press); | 309 generator_->Dispatch(&touch_press); |
| 311 AdvanceSimulatedTimePastTapDelay(); | 310 AdvanceSimulatedTimePastTapDelay(); |
| 312 EXPECT_TRUE(IsInTouchToMouseMode()); | 311 EXPECT_TRUE(IsInTouchToMouseMode()); |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 AdvanceSimulatedTimePastTapDelay(); | 1933 AdvanceSimulatedTimePastTapDelay(); |
| 1935 EXPECT_TRUE(IsInNoFingersDownState()); | 1934 EXPECT_TRUE(IsInNoFingersDownState()); |
| 1936 | 1935 |
| 1937 ASSERT_EQ(1U, GetCapturedEvents().size()); | 1936 ASSERT_EQ(1U, GetCapturedEvents().size()); |
| 1938 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type()); | 1937 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type()); |
| 1939 ClearCapturedEvents(); | 1938 ClearCapturedEvents(); |
| 1940 } | 1939 } |
| 1941 } | 1940 } |
| 1942 | 1941 |
| 1943 } // namespace ui | 1942 } // namespace ui |
| OLD | NEW |