OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/wm/window_manager_impl.h" | 5 #include "athena/wm/window_manager_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "athena/screen/public/screen_manager.h" | 9 #include "athena/screen/public/screen_manager.h" |
10 #include "athena/util/container_priorities.h" | 10 #include "athena/util/container_priorities.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 void AthenaContainerLayoutManager::SetChildBounds( | 143 void AthenaContainerLayoutManager::SetChildBounds( |
144 aura::Window* child, | 144 aura::Window* child, |
145 const gfx::Rect& requested_bounds) { | 145 const gfx::Rect& requested_bounds) { |
146 if (!requested_bounds.IsEmpty()) | 146 if (!requested_bounds.IsEmpty()) |
147 SetChildBoundsDirect(child, requested_bounds); | 147 SetChildBoundsDirect(child, requested_bounds); |
148 } | 148 } |
149 | 149 |
150 WindowManagerImpl::WindowManagerImpl() { | 150 WindowManagerImpl::WindowManagerImpl() { |
151 ScreenManager::ContainerParams params("DefaultContainer", CP_DEFAULT); | 151 ScreenManager::ContainerParams params("DefaultContainer", CP_DEFAULT); |
152 params.can_activate_children = true; | 152 params.can_activate_children = true; |
153 container_.reset(ScreenManager::Get()->CreateDefaultContainer(params)); | 153 params.default_parent = true; |
| 154 params.modal_container_priority = CP_SYSTEM_MODAL; |
| 155 container_.reset(ScreenManager::Get()->CreateContainer(params)); |
154 container_->SetLayoutManager(new AthenaContainerLayoutManager); | 156 container_->SetLayoutManager(new AthenaContainerLayoutManager); |
155 container_->AddObserver(this); | 157 container_->AddObserver(this); |
156 window_list_provider_.reset(new WindowListProviderImpl(container_.get())); | 158 window_list_provider_.reset(new WindowListProviderImpl(container_.get())); |
157 bezel_controller_.reset(new BezelController(container_.get())); | 159 bezel_controller_.reset(new BezelController(container_.get())); |
158 split_view_controller_.reset( | 160 split_view_controller_.reset( |
159 new SplitViewController(container_.get(), window_list_provider_.get())); | 161 new SplitViewController(container_.get(), window_list_provider_.get())); |
160 AddObserver(split_view_controller_.get()); | 162 AddObserver(split_view_controller_.get()); |
161 bezel_controller_->set_left_right_delegate(split_view_controller_.get()); | 163 bezel_controller_->set_left_right_delegate(split_view_controller_.get()); |
162 container_->AddPreTargetHandler(bezel_controller_.get()); | 164 container_->AddPreTargetHandler(bezel_controller_.get()); |
163 title_drag_controller_.reset(new TitleDragController(container_.get(), this)); | 165 title_drag_controller_.reset(new TitleDragController(container_.get(), this)); |
164 wm_state_.reset(new wm::WMState()); | 166 wm_state_.reset(new wm::WMState()); |
165 aura::client::ActivationClient* activation_client = | 167 aura::client::ActivationClient* activation_client = |
166 aura::client::GetActivationClient(container_->GetRootWindow()); | 168 aura::client::GetActivationClient(container_->GetRootWindow()); |
| 169 DCHECK(container_->GetRootWindow()); |
| 170 DCHECK(activation_client); |
167 shadow_controller_.reset(new wm::ShadowController(activation_client)); | 171 shadow_controller_.reset(new wm::ShadowController(activation_client)); |
168 instance = this; | 172 instance = this; |
169 InstallAccelerators(); | 173 InstallAccelerators(); |
170 } | 174 } |
171 | 175 |
172 WindowManagerImpl::~WindowManagerImpl() { | 176 WindowManagerImpl::~WindowManagerImpl() { |
173 overview_.reset(); | 177 overview_.reset(); |
174 RemoveObserver(split_view_controller_.get()); | 178 RemoveObserver(split_view_controller_.get()); |
175 split_view_controller_.reset(); | 179 split_view_controller_.reset(); |
176 window_list_provider_.reset(); | 180 window_list_provider_.reset(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 DCHECK(!instance); | 457 DCHECK(!instance); |
454 } | 458 } |
455 | 459 |
456 // static | 460 // static |
457 WindowManager* WindowManager::Get() { | 461 WindowManager* WindowManager::Get() { |
458 DCHECK(instance); | 462 DCHECK(instance); |
459 return instance; | 463 return instance; |
460 } | 464 } |
461 | 465 |
462 } // namespace athena | 466 } // namespace athena |
OLD | NEW |