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 #include "ui/aura_shell/stacking_controller.h" | 5 #include "ui/aura_shell/stacking_controller.h" |
6 | 6 |
7 #include "ui/aura/client/aura_constants.h" | 7 #include "ui/aura/client/aura_constants.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura_shell/always_on_top_controller.h" | 10 #include "ui/aura_shell/always_on_top_controller.h" |
11 #include "ui/aura_shell/shell.h" | 11 #include "ui/aura_shell/shell.h" |
12 #include "ui/aura_shell/shell_window_ids.h" | 12 #include "ui/aura_shell/shell_window_ids.h" |
13 | 13 |
14 namespace aura_shell { | 14 namespace aura_shell { |
15 namespace internal { | 15 namespace internal { |
16 namespace { | 16 namespace { |
17 | 17 |
18 aura::Window* GetContainer(int id) { | 18 aura::Window* GetContainer(int id) { |
19 return Shell::GetInstance()->GetContainer(id); | 19 return Shell::GetInstance()->GetContainer(id); |
20 } | 20 } |
21 | 21 |
22 bool IsWindowModal(aura::Window* window) { | 22 bool IsWindowModal(aura::Window* window) { |
23 return window->transient_parent() && window->GetIntProperty(aura::kModalKey); | 23 return window->transient_parent() && |
| 24 window->GetIntProperty(aura::client::kModalKey); |
24 } | 25 } |
25 | 26 |
26 } // namespace | 27 } // namespace |
27 | 28 |
28 //////////////////////////////////////////////////////////////////////////////// | 29 //////////////////////////////////////////////////////////////////////////////// |
29 // StackingController, public: | 30 // StackingController, public: |
30 | 31 |
31 StackingController::StackingController() { | 32 StackingController::StackingController() { |
32 aura::client::SetStackingClient(this); | 33 aura::client::SetStackingClient(this); |
33 always_on_top_controller_.reset(new internal::AlwaysOnTopController); | 34 always_on_top_controller_.reset(new internal::AlwaysOnTopController); |
34 always_on_top_controller_->SetContainers( | 35 always_on_top_controller_->SetContainers( |
35 GetContainer(internal::kShellWindowId_DefaultContainer), | 36 GetContainer(internal::kShellWindowId_DefaultContainer), |
36 GetContainer(internal::kShellWindowId_AlwaysOnTopContainer)); | 37 GetContainer(internal::kShellWindowId_AlwaysOnTopContainer)); |
37 } | 38 } |
38 | 39 |
39 StackingController::~StackingController() { | 40 StackingController::~StackingController() { |
40 } | 41 } |
41 | 42 |
42 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
43 // StackingController, aura::StackingClient implementation: | 44 // StackingController, aura::StackingClient implementation: |
44 | 45 |
45 aura::Window* StackingController::GetDefaultParent(aura::Window* window) { | 46 aura::Window* StackingController::GetDefaultParent(aura::Window* window) { |
46 switch (window->type()) { | 47 switch (window->type()) { |
47 case aura::WINDOW_TYPE_NORMAL: | 48 case aura::client::WINDOW_TYPE_NORMAL: |
48 case aura::WINDOW_TYPE_POPUP: | 49 case aura::client::WINDOW_TYPE_POPUP: |
49 if (IsWindowModal(window)) | 50 if (IsWindowModal(window)) |
50 return GetModalContainer(window); | 51 return GetModalContainer(window); |
51 return always_on_top_controller_->GetContainer(window); | 52 return always_on_top_controller_->GetContainer(window); |
52 case aura::WINDOW_TYPE_MENU: | 53 case aura::client::WINDOW_TYPE_MENU: |
53 case aura::WINDOW_TYPE_TOOLTIP: | 54 case aura::client::WINDOW_TYPE_TOOLTIP: |
54 return GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer); | 55 return GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer); |
55 default: | 56 default: |
56 NOTREACHED() << "Window " << window->id() | 57 NOTREACHED() << "Window " << window->id() |
57 << " has unhandled type " << window->type(); | 58 << " has unhandled type " << window->type(); |
58 break; | 59 break; |
59 } | 60 } |
60 return NULL; | 61 return NULL; |
61 } | 62 } |
62 | 63 |
63 //////////////////////////////////////////////////////////////////////////////// | 64 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 20 matching lines...) Expand all Loading... |
84 if (window_container_id < lock_container_id) | 85 if (window_container_id < lock_container_id) |
85 container = GetContainer(internal::kShellWindowId_ModalContainer); | 86 container = GetContainer(internal::kShellWindowId_ModalContainer); |
86 else | 87 else |
87 container = GetContainer(internal::kShellWindowId_LockModalContainer); | 88 container = GetContainer(internal::kShellWindowId_LockModalContainer); |
88 | 89 |
89 return container; | 90 return container; |
90 } | 91 } |
91 | 92 |
92 } // namespace internal | 93 } // namespace internal |
93 } // namespace aura_shell | 94 } // namespace aura_shell |
OLD | NEW |