| 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/screen/public/screen_manager.h" | 5 #include "athena/screen/public/screen_manager.h" |
| 6 | 6 |
| 7 #include "athena/input/public/accelerator_manager.h" | 7 #include "athena/input/public/accelerator_manager.h" |
| 8 #include "athena/screen/screen_accelerator_handler.h" | 8 #include "athena/screen/screen_accelerator_handler.h" |
| 9 #include "athena/util/container_priorities.h" | 9 #include "athena/util/container_priorities.h" |
| 10 #include "athena/util/fill_layout_manager.h" | 10 #include "athena/util/fill_layout_manager.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 ScreenManagerImpl::~ScreenManagerImpl() { | 235 ScreenManagerImpl::~ScreenManagerImpl() { |
| 236 aura::client::SetScreenPositionClient(root_window_, NULL); | 236 aura::client::SetScreenPositionClient(root_window_, NULL); |
| 237 aura::client::SetWindowTreeClient(root_window_, NULL); | 237 aura::client::SetWindowTreeClient(root_window_, NULL); |
| 238 wm::FocusController* focus_controller = | 238 wm::FocusController* focus_controller = |
| 239 static_cast<wm::FocusController*>(focus_client_.get()); | 239 static_cast<wm::FocusController*>(focus_client_.get()); |
| 240 root_window_->RemovePreTargetHandler(focus_controller); | 240 root_window_->RemovePreTargetHandler(focus_controller); |
| 241 aura::client::SetActivationClient(root_window_, NULL); | 241 aura::client::SetActivationClient(root_window_, NULL); |
| 242 aura::client::SetFocusClient(root_window_, NULL); | 242 aura::client::SetFocusClient(root_window_, NULL); |
| 243 aura::Window::Windows children = root_window_->children(); |
| 244 // Close All children: |
| 245 for (aura::Window::Windows::iterator iter = children.begin(); |
| 246 iter != children.end(); |
| 247 ++iter) { |
| 248 delete *iter; |
| 249 } |
| 243 instance = NULL; | 250 instance = NULL; |
| 244 } | 251 } |
| 245 | 252 |
| 246 void ScreenManagerImpl::Init() { | 253 void ScreenManagerImpl::Init() { |
| 247 wm::FocusController* focus_controller = | 254 wm::FocusController* focus_controller = |
| 248 new wm::FocusController(new AthenaFocusRules()); | 255 new wm::FocusController(new AthenaFocusRules()); |
| 249 | 256 |
| 250 aura::client::SetFocusClient(root_window_, focus_controller); | 257 aura::client::SetFocusClient(root_window_, focus_controller); |
| 251 root_window_->AddPreTargetHandler(focus_controller); | 258 root_window_->AddPreTargetHandler(focus_controller); |
| 252 aura::client::SetActivationClient(root_window_, focus_controller); | 259 aura::client::SetActivationClient(root_window_, focus_controller); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 390 } |
| 384 | 391 |
| 385 // static | 392 // static |
| 386 void ScreenManager::Shutdown() { | 393 void ScreenManager::Shutdown() { |
| 387 DCHECK(instance); | 394 DCHECK(instance); |
| 388 delete instance; | 395 delete instance; |
| 389 DCHECK(!instance); | 396 DCHECK(!instance); |
| 390 } | 397 } |
| 391 | 398 |
| 392 } // namespace athena | 399 } // namespace athena |
| OLD | NEW |