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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 virtual void OnWindowVisibilityChanged(aura::Window* window, | 42 virtual void OnWindowVisibilityChanged(aura::Window* window, |
43 bool visible) OVERRIDE; | 43 bool visible) OVERRIDE; |
44 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 44 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
45 | 45 |
46 // Overridden from aura::EnvObserver: | 46 // Overridden from aura::EnvObserver: |
47 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; | 47 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; |
48 | 48 |
49 // Overridden from aura::RootWindowObserver: | 49 // Overridden from aura::RootWindowObserver: |
50 virtual void OnWindowFocused(aura::Window* window) OVERRIDE; | 50 virtual void OnWindowFocused(aura::Window* window) OVERRIDE; |
51 | 51 |
52 void set_default_container_for_test(aura::Window* window) { | |
53 default_container_for_test_ = window; | |
54 } | |
55 | |
56 private: | 52 private: |
57 // Shifts activation to the next window, ignoring |window|. | 53 // Shifts activation to the next window, ignoring |window|. |
58 void ActivateNextWindow(aura::Window* window); | 54 void ActivateNextWindow(aura::Window* window); |
59 | 55 |
60 // Returns the next window that should be activated, ignoring |ignore|. | 56 // Returns the next window that should be activated, ignoring |ignore|. |
61 aura::Window* GetTopmostWindowToActivate(aura::Window* ignore) const; | 57 aura::Window* GetTopmostWindowToActivate(aura::Window* ignore) const; |
62 | 58 |
| 59 // Returns the next window that should be activated in |container| ignoring |
| 60 // the window |ignore|. |
| 61 aura::Window* GetTopmostWindowToActivateInContainer( |
| 62 aura::Window* container, |
| 63 aura::Window* ignore) const; |
| 64 |
63 // True inside ActivateWindow(). Used to prevent recursion of focus | 65 // True inside ActivateWindow(). Used to prevent recursion of focus |
64 // change notifications causing activation. | 66 // change notifications causing activation. |
65 bool updating_activation_; | 67 bool updating_activation_; |
66 | 68 |
67 // For tests that are not running with a Shell instance, | |
68 // ActivationController's attempts to locate the next active window in | |
69 // GetTopmostWindowToActivate() will crash, so we provide this way for such | |
70 // tests to specify a default container. | |
71 aura::Window* default_container_for_test_; | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(ActivationController); | 69 DISALLOW_COPY_AND_ASSIGN(ActivationController); |
74 }; | 70 }; |
75 | 71 |
76 } // namespace internal | 72 } // namespace internal |
77 } // namespace ash | 73 } // namespace ash |
78 | 74 |
79 #endif // ASH_WM_ACTIVATION_CONTROLLER_H_ | 75 #endif // ASH_WM_ACTIVATION_CONTROLLER_H_ |
OLD | NEW |