OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_STACKING_CONTROLLER_H_ | 5 #ifndef UI_AURA_SHELL_STACKING_CONTROLLER_H_ |
6 #define UI_AURA_SHELL_STACKING_CONTROLLER_H_ | 6 #define UI_AURA_SHELL_STACKING_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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ui/aura/client/stacking_client.h" | 12 #include "ui/aura/client/stacking_client.h" |
13 | 13 |
14 namespace aura_shell { | 14 namespace aura_shell { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 class AlwaysOnTopController; | 17 class AlwaysOnTopController; |
18 | 18 |
19 class StackingController : public aura::StackingClient { | 19 class StackingController : public aura::StackingClient { |
20 public: | 20 public: |
21 StackingController(); | 21 StackingController(); |
22 virtual ~StackingController(); | 22 virtual ~StackingController(); |
23 | 23 |
24 // Initializes this controller. | 24 // Initializes this controller. |
25 void Init(); | 25 void Init(); |
26 | 26 |
| 27 // Returns true if |window| exists within a container that supports |
| 28 // activation. |
| 29 static aura::Window* GetActivatableWindow(aura::Window* window); |
| 30 |
27 // Overridden from aura::StackingClient: | 31 // Overridden from aura::StackingClient: |
28 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; | 32 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; |
| 33 virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE; |
| 34 virtual aura::Window* GetTopmostWindowToActivate( |
| 35 aura::Window* ignore) const OVERRIDE; |
29 | 36 |
30 private: | 37 private: |
31 // Returns corresponding modal container for a modal window. | 38 // Returns corresponding modal container for a modal window. |
32 // If screen lock is not active, all modal windows are placed into the | 39 // If screen lock is not active, all modal windows are placed into the |
33 // normal modal container. | 40 // normal modal container. |
34 // Otherwise those that originate from LockScreen container and above are | 41 // Otherwise those that originate from LockScreen container and above are |
35 // placed in the screen lock modal container. | 42 // placed in the screen lock modal container. |
36 aura::Window* GetModalContainer(aura::Window* window) const; | 43 aura::Window* GetModalContainer(aura::Window* window) const; |
37 | 44 |
38 scoped_ptr<internal::AlwaysOnTopController> always_on_top_controller_; | 45 scoped_ptr<internal::AlwaysOnTopController> always_on_top_controller_; |
39 | 46 |
40 DISALLOW_COPY_AND_ASSIGN(StackingController); | 47 DISALLOW_COPY_AND_ASSIGN(StackingController); |
41 }; | 48 }; |
42 | 49 |
43 } // namespace internal | 50 } // namespace internal |
44 } // namespace aura_shell | 51 } // namespace aura_shell |
45 | 52 |
46 #endif // UI_AURA_SHELL_STACKING_CONTROLLER_H_ | 53 #endif // UI_AURA_SHELL_STACKING_CONTROLLER_H_ |
OLD | NEW |