| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ |
| 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/wm/overview/window_selector.h" | 12 #include "ash/wm/overview/window_selector.h" |
| 13 #include "ash/wm/overview/window_selector_delegate.h" | 13 #include "ash/wm/overview/window_selector_delegate.h" |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
| 17 | 17 |
| 18 namespace aura { | 18 namespace aura { |
| 19 class Window; | 19 class Window; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace ui { | |
| 23 class EventHandler; | |
| 24 } | |
| 25 | |
| 26 namespace ash { | 22 namespace ash { |
| 27 | 23 |
| 28 namespace internal { | 24 namespace internal { |
| 29 class WindowSelectorTest; | 25 class WindowSelectorTest; |
| 30 } | 26 } |
| 31 | 27 |
| 32 class WindowSelector; | 28 class WindowSelector; |
| 33 | 29 |
| 34 // Manages a window selector which displays an overview of all windows and | 30 // Manages a window selector which displays an overview of all windows and |
| 35 // allows selecting a window to activate it. | 31 // allows selecting a window to activate it. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 // Enters overview mode. This is essentially the window cycling mode however | 42 // Enters overview mode. This is essentially the window cycling mode however |
| 47 // not released on releasing the alt key and allows selecting with the mouse | 43 // not released on releasing the alt key and allows selecting with the mouse |
| 48 // or touch rather than keypresses. | 44 // or touch rather than keypresses. |
| 49 void ToggleOverview(); | 45 void ToggleOverview(); |
| 50 | 46 |
| 51 // Cycles between windows in the given |direction|. It is assumed that the | 47 // Cycles between windows in the given |direction|. It is assumed that the |
| 52 // alt key is held down and a key filter is installed to watch for alt being | 48 // alt key is held down and a key filter is installed to watch for alt being |
| 53 // released. | 49 // released. |
| 54 void HandleCycleWindow(WindowSelector::Direction direction); | 50 void HandleCycleWindow(WindowSelector::Direction direction); |
| 55 | 51 |
| 56 // Informs the controller that the Alt key has been released and it can | |
| 57 // terminate the existing multi-step cycle. | |
| 58 void AltKeyReleased(); | |
| 59 | |
| 60 // Returns true if window selection mode is active. | 52 // Returns true if window selection mode is active. |
| 61 bool IsSelecting(); | 53 bool IsSelecting(); |
| 62 | 54 |
| 63 // WindowSelectorDelegate: | 55 // WindowSelectorDelegate: |
| 64 virtual void OnWindowSelected(aura::Window* window) OVERRIDE; | 56 virtual void OnWindowSelected(aura::Window* window) OVERRIDE; |
| 65 virtual void OnSelectionCanceled() OVERRIDE; | 57 virtual void OnSelectionCanceled() OVERRIDE; |
| 66 | 58 |
| 67 private: | 59 private: |
| 68 friend class internal::WindowSelectorTest; | 60 friend class internal::WindowSelectorTest; |
| 69 | 61 |
| 70 scoped_ptr<WindowSelector> window_selector_; | 62 scoped_ptr<WindowSelector> window_selector_; |
| 71 scoped_ptr<ui::EventHandler> event_handler_; | |
| 72 | 63 |
| 73 DISALLOW_COPY_AND_ASSIGN(WindowSelectorController); | 64 DISALLOW_COPY_AND_ASSIGN(WindowSelectorController); |
| 74 }; | 65 }; |
| 75 | 66 |
| 76 } // namespace ash | 67 } // namespace ash |
| 77 | 68 |
| 78 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ | 69 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_ |
| OLD | NEW |