| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | |
| 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 #include <memory> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "ash/ash_export.h" | |
| 13 #include "ash/wm/overview/window_selector.h" | |
| 14 #include "ash/wm/overview/window_selector_delegate.h" | |
| 15 #include "base/macros.h" | |
| 16 #include "base/time/time.h" | |
| 17 | |
| 18 namespace ash { | |
| 19 class WindowSelector; | |
| 20 class WindowSelectorTest; | |
| 21 | |
| 22 // Manages a window selector which displays an overview of all windows and | |
| 23 // allows selecting a window to activate it. | |
| 24 class ASH_EXPORT WindowSelectorController | |
| 25 : public WindowSelectorDelegate { | |
| 26 public: | |
| 27 WindowSelectorController(); | |
| 28 ~WindowSelectorController() override; | |
| 29 | |
| 30 // Returns true if selecting windows in an overview is enabled. This is false | |
| 31 // at certain times, such as when the lock screen is visible. | |
| 32 static bool CanSelect(); | |
| 33 | |
| 34 // Enters overview mode. This is essentially the window cycling mode however | |
| 35 // not released on releasing the alt key and allows selecting with the mouse | |
| 36 // or touch rather than keypresses. | |
| 37 void ToggleOverview(); | |
| 38 | |
| 39 // Returns true if window selection mode is active. | |
| 40 bool IsSelecting(); | |
| 41 | |
| 42 // Returns true if overview mode is restoring minimized windows so that they | |
| 43 // are visible during overview mode. | |
| 44 bool IsRestoringMinimizedWindows() const; | |
| 45 | |
| 46 // WindowSelectorDelegate: | |
| 47 void OnSelectionEnded() override; | |
| 48 | |
| 49 private: | |
| 50 friend class WindowSelectorTest; | |
| 51 | |
| 52 // Dispatched when window selection begins. | |
| 53 void OnSelectionStarted(); | |
| 54 | |
| 55 std::unique_ptr<WindowSelector> window_selector_; | |
| 56 base::Time last_selection_time_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(WindowSelectorController); | |
| 59 }; | |
| 60 | |
| 61 } // namespace ash | |
| 62 | |
| 63 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | |
| OLD | NEW |