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

Side by Side Diff: ash/shell.cc

Issue 1614233002: Shutdown the status tray before the system tray delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 11 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
« ash/root_window_controller.cc ('K') | « ash/shell.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 keyboard::KeyboardController::ResetInstance(nullptr); 469 keyboard::KeyboardController::ResetInstance(nullptr);
470 } 470 }
471 471
472 void Shell::ShowShelf() { 472 void Shell::ShowShelf() {
473 RootWindowControllerList controllers = GetAllRootWindowControllers(); 473 RootWindowControllerList controllers = GetAllRootWindowControllers();
474 for (RootWindowControllerList::iterator iter = controllers.begin(); 474 for (RootWindowControllerList::iterator iter = controllers.begin();
475 iter != controllers.end(); ++iter) 475 iter != controllers.end(); ++iter)
476 (*iter)->ShowShelf(); 476 (*iter)->ShowShelf();
477 } 477 }
478 478
479 void Shell::HideShelf() {
480 RootWindowControllerList controllers = GetAllRootWindowControllers();
481 for (RootWindowControllerList::iterator iter = controllers.begin();
482 iter != controllers.end(); ++iter) {
483 if ((*iter)->shelf())
484 (*iter)->shelf()->ShutdownStatusAreaWidget();
485 }
486 }
487
479 void Shell::AddShellObserver(ShellObserver* observer) { 488 void Shell::AddShellObserver(ShellObserver* observer) {
480 observers_.AddObserver(observer); 489 observers_.AddObserver(observer);
481 } 490 }
482 491
483 void Shell::RemoveShellObserver(ShellObserver* observer) { 492 void Shell::RemoveShellObserver(ShellObserver* observer) {
484 observers_.RemoveObserver(observer); 493 observers_.RemoveObserver(observer);
485 } 494 }
486 495
487 #if defined(OS_CHROMEOS) 496 #if defined(OS_CHROMEOS)
488 bool Shell::ShouldSaveDisplaySettings() { 497 bool Shell::ShouldSaveDisplaySettings() {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 722
714 #if defined(OS_CHROMEOS) 723 #if defined(OS_CHROMEOS)
715 // Destroy the LastWindowClosedLogoutReminder before the 724 // Destroy the LastWindowClosedLogoutReminder before the
716 // LogoutConfirmationController. 725 // LogoutConfirmationController.
717 last_window_closed_logout_reminder_.reset(); 726 last_window_closed_logout_reminder_.reset();
718 727
719 // Destroy the LogoutConfirmationController before the SystemTrayDelegate. 728 // Destroy the LogoutConfirmationController before the SystemTrayDelegate.
720 logout_confirmation_controller_.reset(); 729 logout_confirmation_controller_.reset();
721 #endif 730 #endif
722 731
723 // Destroy SystemTrayDelegate before destroying the status area(s). 732 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure
733 // to deinitialize the shelf first, as it is initialized after the delegate.
734 HideShelf();
724 system_tray_delegate_->Shutdown(); 735 system_tray_delegate_->Shutdown();
725 system_tray_delegate_.reset(); 736 system_tray_delegate_.reset();
726 737
727 locale_notification_controller_.reset(); 738 locale_notification_controller_.reset();
728 739
729 // Drag-and-drop must be canceled prior to close all windows. 740 // Drag-and-drop must be canceled prior to close all windows.
730 drag_drop_controller_.reset(); 741 drag_drop_controller_.reset();
731 742
732 // Controllers who have WindowObserver added must be deleted 743 // Controllers who have WindowObserver added must be deleted
733 // before |window_tree_host_manager_| is deleted. 744 // before |window_tree_host_manager_| is deleted.
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 1179
1169 void Shell::OnWindowActivated( 1180 void Shell::OnWindowActivated(
1170 aura::client::ActivationChangeObserver::ActivationReason reason, 1181 aura::client::ActivationChangeObserver::ActivationReason reason,
1171 aura::Window* gained_active, 1182 aura::Window* gained_active,
1172 aura::Window* lost_active) { 1183 aura::Window* lost_active) {
1173 if (gained_active) 1184 if (gained_active)
1174 target_root_window_ = gained_active->GetRootWindow(); 1185 target_root_window_ = gained_active->GetRootWindow();
1175 } 1186 }
1176 1187
1177 } // namespace ash 1188 } // namespace ash
OLDNEW
« ash/root_window_controller.cc ('K') | « ash/shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698