OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ACTIVATION_CONTROLLER_H_ | 5 #ifndef ASH_WM_ACTIVATION_CONTROLLER_H_ |
6 #define ASH_WM_ACTIVATION_CONTROLLER_H_ | 6 #define ASH_WM_ACTIVATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 public aura::EnvObserver, | 31 public aura::EnvObserver, |
32 public aura::FocusChangeObserver { | 32 public aura::FocusChangeObserver { |
33 public: | 33 public: |
34 explicit ActivationController(aura::FocusManager* focus_manager); | 34 explicit ActivationController(aura::FocusManager* focus_manager); |
35 virtual ~ActivationController(); | 35 virtual ~ActivationController(); |
36 | 36 |
37 // Returns true if |window| exists within a container that supports | 37 // Returns true if |window| exists within a container that supports |
38 // activation. |event| is the revent responsible for initiating the change, or | 38 // activation. |event| is the revent responsible for initiating the change, or |
39 // NULL if there is no event. | 39 // NULL if there is no event. |
40 static aura::Window* GetActivatableWindow(aura::Window* window, | 40 static aura::Window* GetActivatableWindow(aura::Window* window, |
41 const aura::Event* event); | 41 const ui::Event* event); |
42 | 42 |
43 // Overridden from aura::client::ActivationClient: | 43 // Overridden from aura::client::ActivationClient: |
44 virtual void AddObserver( | 44 virtual void AddObserver( |
45 aura::client::ActivationChangeObserver* observer) OVERRIDE; | 45 aura::client::ActivationChangeObserver* observer) OVERRIDE; |
46 virtual void RemoveObserver( | 46 virtual void RemoveObserver( |
47 aura::client::ActivationChangeObserver* observer) OVERRIDE; | 47 aura::client::ActivationChangeObserver* observer) OVERRIDE; |
48 virtual void ActivateWindow(aura::Window* window) OVERRIDE; | 48 virtual void ActivateWindow(aura::Window* window) OVERRIDE; |
49 virtual void DeactivateWindow(aura::Window* window) OVERRIDE; | 49 virtual void DeactivateWindow(aura::Window* window) OVERRIDE; |
50 virtual aura::Window* GetActiveWindow() OVERRIDE; | 50 virtual aura::Window* GetActiveWindow() OVERRIDE; |
51 virtual bool OnWillFocusWindow(aura::Window* window, | 51 virtual bool OnWillFocusWindow(aura::Window* window, |
52 const aura::Event* event) OVERRIDE; | 52 const ui::Event* event) OVERRIDE; |
53 virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE; | 53 virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE; |
54 | 54 |
55 // Overridden from aura::WindowObserver: | 55 // Overridden from aura::WindowObserver: |
56 virtual void OnWindowVisibilityChanged(aura::Window* window, | 56 virtual void OnWindowVisibilityChanged(aura::Window* window, |
57 bool visible) OVERRIDE; | 57 bool visible) OVERRIDE; |
58 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 58 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
59 | 59 |
60 // Overridden from aura::EnvObserver: | 60 // Overridden from aura::EnvObserver: |
61 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; | 61 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; |
62 | 62 |
63 // Overridden from aura::FocusChangeObserver: | 63 // Overridden from aura::FocusChangeObserver: |
64 virtual void OnWindowFocused(aura::Window* window) OVERRIDE; | 64 virtual void OnWindowFocused(aura::Window* window) OVERRIDE; |
65 | 65 |
66 private: | 66 private: |
67 // Implementation of ActivateWindow() with an Event. | 67 // Implementation of ActivateWindow() with an Event. |
68 void ActivateWindowWithEvent(aura::Window* window, | 68 void ActivateWindowWithEvent(aura::Window* window, |
69 const aura::Event* event); | 69 const ui::Event* event); |
70 | 70 |
71 // Shifts activation to the next window, ignoring |window|. Returns the next | 71 // Shifts activation to the next window, ignoring |window|. Returns the next |
72 // window. | 72 // window. |
73 aura::Window* ActivateNextWindow(aura::Window* window); | 73 aura::Window* ActivateNextWindow(aura::Window* window); |
74 | 74 |
75 // Returns the next window that should be activated, ignoring |ignore|. | 75 // Returns the next window that should be activated, ignoring |ignore|. |
76 aura::Window* GetTopmostWindowToActivate(aura::Window* ignore) const; | 76 aura::Window* GetTopmostWindowToActivate(aura::Window* ignore) const; |
77 | 77 |
78 // Returns the next window that should be activated in |container| ignoring | 78 // Returns the next window that should be activated in |container| ignoring |
79 // the window |ignore|. | 79 // the window |ignore|. |
(...skipping 13 matching lines...) Expand all Loading... |
93 | 93 |
94 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 94 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(ActivationController); | 96 DISALLOW_COPY_AND_ASSIGN(ActivationController); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace internal | 99 } // namespace internal |
100 } // namespace ash | 100 } // namespace ash |
101 | 101 |
102 #endif // ASH_WM_ACTIVATION_CONTROLLER_H_ | 102 #endif // ASH_WM_ACTIVATION_CONTROLLER_H_ |
OLD | NEW |