| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
| 17 #include "ui/wm/public/activation_change_observer.h" | 17 #include "ui/wm/public/activation_change_observer.h" |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 class RootWindow; | 20 class RootWindow; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 class EventHandler; | 24 class EventHandler; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 | |
| 29 namespace internal { | |
| 30 class WindowSelectorTest; | |
| 31 } | |
| 32 | |
| 33 class ScopedShowWindow; | 28 class ScopedShowWindow; |
| 34 class WindowOverview; | 29 class WindowOverview; |
| 35 class WindowSelectorDelegate; | 30 class WindowSelectorDelegate; |
| 36 class WindowSelectorItem; | 31 class WindowSelectorItem; |
| 32 class WindowSelectorTest; |
| 37 | 33 |
| 38 // The WindowSelector allows selecting a window by alt-tabbing (CYCLE mode) or | 34 // The WindowSelector allows selecting a window by alt-tabbing (CYCLE mode) or |
| 39 // by clicking or tapping on it (OVERVIEW mode). A WindowOverview will be shown | 35 // by clicking or tapping on it (OVERVIEW mode). A WindowOverview will be shown |
| 40 // in OVERVIEW mode or if the user lingers on a window while alt tabbing. | 36 // in OVERVIEW mode or if the user lingers on a window while alt tabbing. |
| 41 class ASH_EXPORT WindowSelector | 37 class ASH_EXPORT WindowSelector |
| 42 : public aura::WindowObserver, | 38 : public aura::WindowObserver, |
| 43 public aura::client::ActivationChangeObserver { | 39 public aura::client::ActivationChangeObserver { |
| 44 public: | 40 public: |
| 45 enum Direction { | 41 enum Direction { |
| 46 FORWARD, | 42 FORWARD, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 76 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 81 | 77 |
| 82 // Overridden from aura::client::ActivationChangeObserver: | 78 // Overridden from aura::client::ActivationChangeObserver: |
| 83 virtual void OnWindowActivated(aura::Window* gained_active, | 79 virtual void OnWindowActivated(aura::Window* gained_active, |
| 84 aura::Window* lost_active) OVERRIDE; | 80 aura::Window* lost_active) OVERRIDE; |
| 85 virtual void OnAttemptToReactivateWindow( | 81 virtual void OnAttemptToReactivateWindow( |
| 86 aura::Window* request_active, | 82 aura::Window* request_active, |
| 87 aura::Window* actual_active) OVERRIDE; | 83 aura::Window* actual_active) OVERRIDE; |
| 88 | 84 |
| 89 private: | 85 private: |
| 90 friend class internal::WindowSelectorTest; | 86 friend class WindowSelectorTest; |
| 91 | 87 |
| 92 // Begins positioning windows such that all windows are visible on the screen. | 88 // Begins positioning windows such that all windows are visible on the screen. |
| 93 void StartOverview(); | 89 void StartOverview(); |
| 94 | 90 |
| 95 // Resets the stored window from RemoveFocusAndSetRestoreWindow to NULL. If | 91 // Resets the stored window from RemoveFocusAndSetRestoreWindow to NULL. If |
| 96 // |focus|, restores focus to the stored window. | 92 // |focus|, restores focus to the stored window. |
| 97 void ResetFocusRestoreWindow(bool focus); | 93 void ResetFocusRestoreWindow(bool focus); |
| 98 | 94 |
| 99 // The collection of items in the overview wrapped by a helper class which | 95 // The collection of items in the overview wrapped by a helper class which |
| 100 // restores their state and helps transform them to other root windows. | 96 // restores their state and helps transform them to other root windows. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // True when performing operations that may cause window activations. This is | 130 // True when performing operations that may cause window activations. This is |
| 135 // used to prevent handling the resulting expected activation. | 131 // used to prevent handling the resulting expected activation. |
| 136 bool ignore_activations_; | 132 bool ignore_activations_; |
| 137 | 133 |
| 138 DISALLOW_COPY_AND_ASSIGN(WindowSelector); | 134 DISALLOW_COPY_AND_ASSIGN(WindowSelector); |
| 139 }; | 135 }; |
| 140 | 136 |
| 141 } // namespace ash | 137 } // namespace ash |
| 142 | 138 |
| 143 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 139 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
| OLD | NEW |