| 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 ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ | 5 #ifndef ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ |
| 6 #define ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ | 6 #define ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Controls cycling through windows with the keyboard via alt-tab. | 23 // Controls cycling through windows with the keyboard via alt-tab. |
| 24 // Windows are sorted primarily by most recently used, and then by screen order. | 24 // Windows are sorted primarily by most recently used, and then by screen order. |
| 25 // We activate windows as you cycle through them, so the order on the screen | 25 // We activate windows as you cycle through them, so the order on the screen |
| 26 // may change during the gesture, but the most recently used list isn't updated | 26 // may change during the gesture, but the most recently used list isn't updated |
| 27 // until the cycling ends. Thus we maintain the state of the windows | 27 // until the cycling ends. Thus we maintain the state of the windows |
| 28 // at the beginning of the gesture so you can cycle through in a consistent | 28 // at the beginning of the gesture so you can cycle through in a consistent |
| 29 // order. | 29 // order. |
| 30 class ASH_EXPORT WindowCycleController { | 30 class ASH_EXPORT WindowCycleController { |
| 31 public: | 31 public: |
| 32 enum Direction { | 32 enum Direction { FORWARD, BACKWARD }; |
| 33 FORWARD, | |
| 34 BACKWARD | |
| 35 }; | |
| 36 | 33 |
| 37 WindowCycleController(); | 34 WindowCycleController(); |
| 38 virtual ~WindowCycleController(); | 35 virtual ~WindowCycleController(); |
| 39 | 36 |
| 40 // Returns true if cycling through windows is enabled. This is false at | 37 // Returns true if cycling through windows is enabled. This is false at |
| 41 // certain times, such as when the lock screen is visible. | 38 // certain times, such as when the lock screen is visible. |
| 42 static bool CanCycle(); | 39 static bool CanCycle(); |
| 43 | 40 |
| 44 // Cycles between windows in the given |direction|. | 41 // Cycles between windows in the given |direction|. |
| 45 void HandleCycleWindow(Direction direction); | 42 void HandleCycleWindow(Direction direction); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 73 std::unique_ptr<ui::EventHandler> event_handler_; | 70 std::unique_ptr<ui::EventHandler> event_handler_; |
| 74 | 71 |
| 75 base::Time cycle_start_time_; | 72 base::Time cycle_start_time_; |
| 76 | 73 |
| 77 DISALLOW_COPY_AND_ASSIGN(WindowCycleController); | 74 DISALLOW_COPY_AND_ASSIGN(WindowCycleController); |
| 78 }; | 75 }; |
| 79 | 76 |
| 80 } // namespace ash | 77 } // namespace ash |
| 81 | 78 |
| 82 #endif // ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ | 79 #endif // ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ |
| OLD | NEW |