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_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "ui/aura/client/activation_change_observer.h" | 15 #include "ui/aura/client/activation_change_observer.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 RootWindow; | 19 class RootWindow; |
20 } | 20 } |
21 | 21 |
22 namespace ui { | 22 namespace ui { |
23 class LocatedEvent; | 23 class EventHandler; |
24 } | 24 } |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 | 27 |
28 namespace internal { | 28 namespace internal { |
29 class WindowSelectorTest; | 29 class WindowSelectorTest; |
30 } | 30 } |
31 | 31 |
32 class WindowOverview; | 32 class WindowOverview; |
33 class WindowSelectorDelegate; | 33 class WindowSelectorDelegate; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // |focus|, restores focus to the stored window. | 94 // |focus|, restores focus to the stored window. |
95 void ResetFocusRestoreWindow(bool focus); | 95 void ResetFocusRestoreWindow(bool focus); |
96 | 96 |
97 // The collection of windows in the overview wrapped by a helper class which | 97 // The collection of windows in the overview wrapped by a helper class which |
98 // restores their state and helps transform them to other root windows. | 98 // restores their state and helps transform them to other root windows. |
99 ScopedVector<WindowSelectorWindow> windows_; | 99 ScopedVector<WindowSelectorWindow> windows_; |
100 | 100 |
101 // The window selection mode. | 101 // The window selection mode. |
102 Mode mode_; | 102 Mode mode_; |
103 | 103 |
| 104 // An event handler listening for the release of the alt key during alt-tab |
| 105 // cycling. |
| 106 scoped_ptr<ui::EventHandler> event_handler_; |
| 107 |
104 base::DelayTimer<WindowSelector> start_overview_timer_; | 108 base::DelayTimer<WindowSelector> start_overview_timer_; |
105 scoped_ptr<WindowOverview> window_overview_; | 109 scoped_ptr<WindowOverview> window_overview_; |
106 | 110 |
107 // Weak pointer to the selector delegate which will be called when a | 111 // Weak pointer to the selector delegate which will be called when a |
108 // selection is made. | 112 // selection is made. |
109 WindowSelectorDelegate* delegate_; | 113 WindowSelectorDelegate* delegate_; |
110 | 114 |
111 // Index of the currently selected window if the mode is CYCLE. | 115 // Index of the currently selected window if the mode is CYCLE. |
112 size_t selected_window_; | 116 size_t selected_window_; |
113 | 117 |
114 // A weak pointer to the window which was focused on entering overview mode. | 118 // A weak pointer to the window which was focused on entering overview mode. |
115 // If overview mode is canceled the focus should be restored to this window. | 119 // If overview mode is canceled the focus should be restored to this window. |
116 aura::Window* restore_focus_window_; | 120 aura::Window* restore_focus_window_; |
117 | 121 |
118 // True when restoring focus to the window. This is used to prevent handling | 122 // True when restoring focus to the window. This is used to prevent handling |
119 // the resulting activation. | 123 // the resulting activation. |
120 bool restoring_focus_; | 124 bool restoring_focus_; |
121 | 125 |
122 DISALLOW_COPY_AND_ASSIGN(WindowSelector); | 126 DISALLOW_COPY_AND_ASSIGN(WindowSelector); |
123 }; | 127 }; |
124 | 128 |
125 } // namespace ash | 129 } // namespace ash |
126 | 130 |
127 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 131 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
OLD | NEW |