Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: athena/wm/window_manager_impl.cc

Issue 662763002: Support modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix leaks Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « athena/wm/window_list_provider_impl_unittest.cc ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « athena/wm/window_list_provider_impl_unittest.cc ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698