Chromium Code Reviews| 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 #ifndef UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 5 #ifndef UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| 6 #define UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 6 #define UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 // SCREEN_CENTER. | 334 // SCREEN_CENTER. |
| 335 int FindEdgesWithinBounds(gfx::Point point, float bounds); | 335 int FindEdgesWithinBounds(gfx::Point point, float bounds); |
| 336 | 336 |
| 337 void VlogState(const char* function_name); | 337 void VlogState(const char* function_name); |
| 338 | 338 |
| 339 void VlogEvent(const ui::TouchEvent& event, const char* function_name); | 339 void VlogEvent(const ui::TouchEvent& event, const char* function_name); |
| 340 | 340 |
| 341 // Gets enum name from integer value. | 341 // Gets enum name from integer value. |
| 342 const char* EnumStateToString(State state); | 342 const char* EnumStateToString(State state); |
| 343 | 343 |
| 344 // Maps each single/multi finger swipe to the function that dispatches | |
| 345 // the corresponding key events. | |
| 346 void InitializeSwipeClosures(); | |
|
aboxhall
2014/08/05 23:43:42
I think the fact that they're closures is an imple
evy
2014/08/05 23:51:18
Done.
| |
| 347 | |
| 344 aura::Window* root_window_; | 348 aura::Window* root_window_; |
| 345 | 349 |
| 346 // Handles volume control. Not owned. | 350 // Handles volume control. Not owned. |
| 347 ui::TouchExplorationControllerDelegate* delegate_; | 351 ui::TouchExplorationControllerDelegate* delegate_; |
| 348 | 352 |
| 349 // A set of touch ids for fingers currently touching the screen. | 353 // A set of touch ids for fingers currently touching the screen. |
| 350 std::vector<int> current_touch_ids_; | 354 std::vector<int> current_touch_ids_; |
| 351 | 355 |
| 352 // Map of touch ids to their last known location. | 356 // Map of touch ids to their last known location. |
| 353 std::map<int, gfx::PointF> touch_locations_; | 357 std::map<int, gfx::PointF> touch_locations_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 // A copy of the previous event passed. | 398 // A copy of the previous event passed. |
| 395 scoped_ptr<ui::TouchEvent> prev_event_; | 399 scoped_ptr<ui::TouchEvent> prev_event_; |
| 396 | 400 |
| 397 // This toggles whether VLOGS are turned on or not. | 401 // This toggles whether VLOGS are turned on or not. |
| 398 bool VLOG_on_; | 402 bool VLOG_on_; |
| 399 | 403 |
| 400 // When touch_exploration_controller gets time relative to real time during | 404 // When touch_exploration_controller gets time relative to real time during |
| 401 // testing, this clock is set to the simulated clock and used. | 405 // testing, this clock is set to the simulated clock and used. |
| 402 base::TickClock* tick_clock_; | 406 base::TickClock* tick_clock_; |
| 403 | 407 |
| 408 // Maps swipes with the resulting functions that dispatch key events. | |
| 409 std::map<int, base::Closure> left_swipe_gestures_; | |
| 410 std::map<int, base::Closure> right_swipe_gestures_; | |
| 411 std::map<int, base::Closure> up_swipe_gestures_; | |
| 412 std::map<int, base::Closure> down_swipe_gestures_; | |
| 413 | |
| 404 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); | 414 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
| 405 }; | 415 }; |
| 406 | 416 |
| 407 } // namespace ui | 417 } // namespace ui |
| 408 | 418 |
| 409 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 419 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| OLD | NEW |