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

Side by Side Diff: athena/screen/screen_manager_impl.cc

Issue 558823002: Fix crash during shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/env/athena_env_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/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
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
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
OLDNEW
« no previous file with comments | « athena/env/athena_env_unittest.cc ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698