| 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 params.default_parent = true; | 153 container_.reset(ScreenManager::Get()->CreateDefaultContainer(params)); |
| 154 params.modal_container_priority = CP_SYSTEM_MODAL; | |
| 155 container_.reset(ScreenManager::Get()->CreateContainer(params)); | |
| 156 container_->SetLayoutManager(new AthenaContainerLayoutManager); | 154 container_->SetLayoutManager(new AthenaContainerLayoutManager); |
| 157 container_->AddObserver(this); | 155 container_->AddObserver(this); |
| 158 window_list_provider_.reset(new WindowListProviderImpl(container_.get())); | 156 window_list_provider_.reset(new WindowListProviderImpl(container_.get())); |
| 159 bezel_controller_.reset(new BezelController(container_.get())); | 157 bezel_controller_.reset(new BezelController(container_.get())); |
| 160 split_view_controller_.reset( | 158 split_view_controller_.reset( |
| 161 new SplitViewController(container_.get(), window_list_provider_.get())); | 159 new SplitViewController(container_.get(), window_list_provider_.get())); |
| 162 AddObserver(split_view_controller_.get()); | 160 AddObserver(split_view_controller_.get()); |
| 163 bezel_controller_->set_left_right_delegate(split_view_controller_.get()); | 161 bezel_controller_->set_left_right_delegate(split_view_controller_.get()); |
| 164 container_->AddPreTargetHandler(bezel_controller_.get()); | 162 container_->AddPreTargetHandler(bezel_controller_.get()); |
| 165 title_drag_controller_.reset(new TitleDragController(container_.get(), this)); | 163 title_drag_controller_.reset(new TitleDragController(container_.get(), this)); |
| 166 wm_state_.reset(new wm::WMState()); | 164 wm_state_.reset(new wm::WMState()); |
| 167 aura::client::ActivationClient* activation_client = | 165 aura::client::ActivationClient* activation_client = |
| 168 aura::client::GetActivationClient(container_->GetRootWindow()); | 166 aura::client::GetActivationClient(container_->GetRootWindow()); |
| 169 DCHECK(container_->GetRootWindow()); | |
| 170 DCHECK(activation_client); | |
| 171 shadow_controller_.reset(new wm::ShadowController(activation_client)); | 167 shadow_controller_.reset(new wm::ShadowController(activation_client)); |
| 172 instance = this; | 168 instance = this; |
| 173 InstallAccelerators(); | 169 InstallAccelerators(); |
| 174 } | 170 } |
| 175 | 171 |
| 176 WindowManagerImpl::~WindowManagerImpl() { | 172 WindowManagerImpl::~WindowManagerImpl() { |
| 177 overview_.reset(); | 173 overview_.reset(); |
| 178 RemoveObserver(split_view_controller_.get()); | 174 RemoveObserver(split_view_controller_.get()); |
| 179 split_view_controller_.reset(); | 175 split_view_controller_.reset(); |
| 180 window_list_provider_.reset(); | 176 window_list_provider_.reset(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 DCHECK(!instance); | 453 DCHECK(!instance); |
| 458 } | 454 } |
| 459 | 455 |
| 460 // static | 456 // static |
| 461 WindowManager* WindowManager::Get() { | 457 WindowManager* WindowManager::Get() { |
| 462 DCHECK(instance); | 458 DCHECK(instance); |
| 463 return instance; | 459 return instance; |
| 464 } | 460 } |
| 465 | 461 |
| 466 } // namespace athena | 462 } // namespace athena |
| OLD | NEW |