| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 | 13 |
| 14 namespace aura { |
| 15 class Window; |
| 16 } |
| 17 |
| 14 namespace ash { | 18 namespace ash { |
| 15 | 19 |
| 16 class WindowCycleEventFilter; | 20 class WindowCycleEventFilter; |
| 17 class WindowCycleList; | 21 class WindowCycleList; |
| 18 class WmWindow; | |
| 19 | 22 |
| 20 // Controls cycling through windows with the keyboard via alt-tab. | 23 // Controls cycling through windows with the keyboard via alt-tab. |
| 21 // 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. |
| 22 // 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 |
| 23 // 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 |
| 24 // 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 |
| 25 // 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 |
| 26 // order. | 29 // order. |
| 27 class ASH_EXPORT WindowCycleController { | 30 class ASH_EXPORT WindowCycleController { |
| 28 public: | 31 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 private: | 63 private: |
| 61 // Cycles to the next or previous window based on |direction|. | 64 // Cycles to the next or previous window based on |direction|. |
| 62 void Step(Direction direction); | 65 void Step(Direction direction); |
| 63 | 66 |
| 64 void StopCycling(); | 67 void StopCycling(); |
| 65 | 68 |
| 66 std::unique_ptr<WindowCycleList> window_cycle_list_; | 69 std::unique_ptr<WindowCycleList> window_cycle_list_; |
| 67 | 70 |
| 68 // Tracks what Window was active when starting to cycle and used to determine | 71 // Tracks what Window was active when starting to cycle and used to determine |
| 69 // if the active Window changed in when ending cycling. | 72 // if the active Window changed in when ending cycling. |
| 70 WmWindow* active_window_before_window_cycle_ = nullptr; | 73 aura::Window* active_window_before_window_cycle_ = nullptr; |
| 71 | 74 |
| 72 // Non-null while actively cycling. | 75 // Non-null while actively cycling. |
| 73 std::unique_ptr<WindowCycleEventFilter> event_filter_; | 76 std::unique_ptr<WindowCycleEventFilter> event_filter_; |
| 74 | 77 |
| 75 base::Time cycle_start_time_; | 78 base::Time cycle_start_time_; |
| 76 | 79 |
| 77 DISALLOW_COPY_AND_ASSIGN(WindowCycleController); | 80 DISALLOW_COPY_AND_ASSIGN(WindowCycleController); |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 } // namespace ash | 83 } // namespace ash |
| 81 | 84 |
| 82 #endif // ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ | 85 #endif // ASH_WM_WINDOW_CYCLE_CONTROLLER_H_ |
| OLD | NEW |