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

Side by Side Diff: ash/shell.cc

Issue 2000393003: ash: Reorder shutdown of ShelfLayoutManager and StatusAreaWidget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 | « ash/shell.h ('k') | ash/wm/aura/wm_shelf_aura.h » ('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 (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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 keyboard::KeyboardController::ResetInstance(nullptr); 479 keyboard::KeyboardController::ResetInstance(nullptr);
480 } 480 }
481 481
482 void Shell::ShowShelf() { 482 void Shell::ShowShelf() {
483 RootWindowControllerList controllers = GetAllRootWindowControllers(); 483 RootWindowControllerList controllers = GetAllRootWindowControllers();
484 for (RootWindowControllerList::iterator iter = controllers.begin(); 484 for (RootWindowControllerList::iterator iter = controllers.begin();
485 iter != controllers.end(); ++iter) 485 iter != controllers.end(); ++iter)
486 (*iter)->ShowShelf(); 486 (*iter)->ShowShelf();
487 } 487 }
488 488
489 void Shell::HideShelf() { 489 void Shell::ShutdownShelf() {
490 RootWindowControllerList controllers = GetAllRootWindowControllers(); 490 RootWindowControllerList controllers = GetAllRootWindowControllers();
491 for (RootWindowControllerList::iterator iter = controllers.begin(); 491 for (RootWindowControllerList::iterator iter = controllers.begin();
492 iter != controllers.end(); ++iter) { 492 iter != controllers.end(); ++iter) {
493 if ((*iter)->shelf()) 493 if ((*iter)->shelf())
494 (*iter)->shelf()->ShutdownStatusAreaWidget(); 494 (*iter)->shelf()->Shutdown();
495 } 495 }
496 } 496 }
497 497
498 void Shell::AddShellObserver(ShellObserver* observer) { 498 void Shell::AddShellObserver(ShellObserver* observer) {
499 observers_.AddObserver(observer); 499 observers_.AddObserver(observer);
500 } 500 }
501 501
502 void Shell::RemoveShellObserver(ShellObserver* observer) { 502 void Shell::RemoveShellObserver(ShellObserver* observer) {
503 observers_.RemoveObserver(observer); 503 observers_.RemoveObserver(observer);
504 } 504 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 747
748 // Destroy the keyboard before closing the shelf, since it will invoke a shelf 748 // Destroy the keyboard before closing the shelf, since it will invoke a shelf
749 // layout. 749 // layout.
750 DeactivateKeyboard(); 750 DeactivateKeyboard();
751 751
752 // Destroy toasts 752 // Destroy toasts
753 toast_manager_.reset(); 753 toast_manager_.reset();
754 754
755 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure 755 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure
756 // to deinitialize the shelf first, as it is initialized after the delegate. 756 // to deinitialize the shelf first, as it is initialized after the delegate.
757 HideShelf(); 757 ShutdownShelf();
758 system_tray_delegate_->Shutdown(); 758 system_tray_delegate_->Shutdown();
759 system_tray_delegate_.reset(); 759 system_tray_delegate_.reset();
760 760
761 locale_notification_controller_.reset(); 761 locale_notification_controller_.reset();
762 762
763 // Drag-and-drop must be canceled prior to close all windows. 763 // Drag-and-drop must be canceled prior to close all windows.
764 drag_drop_controller_.reset(); 764 drag_drop_controller_.reset();
765 765
766 // Controllers who have WindowObserver added must be deleted 766 // Controllers who have WindowObserver added must be deleted
767 // before |window_tree_host_manager_| is deleted. 767 // before |window_tree_host_manager_| is deleted.
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 1265
1266 void Shell::OnWindowActivated( 1266 void Shell::OnWindowActivated(
1267 aura::client::ActivationChangeObserver::ActivationReason reason, 1267 aura::client::ActivationChangeObserver::ActivationReason reason,
1268 aura::Window* gained_active, 1268 aura::Window* gained_active,
1269 aura::Window* lost_active) { 1269 aura::Window* lost_active) {
1270 if (gained_active) 1270 if (gained_active)
1271 target_root_window_ = gained_active->GetRootWindow(); 1271 target_root_window_ = gained_active->GetRootWindow();
1272 } 1272 }
1273 1273
1274 } // namespace ash 1274 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/aura/wm_shelf_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698