OLD | NEW |
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 Loading... |
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 Loading... |
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 the keyboard before closing the shelf, since it will invoke a shelf |
| 733 // layout. |
| 734 DeactivateKeyboard(); |
| 735 |
| 736 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure |
| 737 // to deinitialize the shelf first, as it is initialized after the delegate. |
| 738 HideShelf(); |
724 system_tray_delegate_->Shutdown(); | 739 system_tray_delegate_->Shutdown(); |
725 system_tray_delegate_.reset(); | 740 system_tray_delegate_.reset(); |
726 | 741 |
727 locale_notification_controller_.reset(); | 742 locale_notification_controller_.reset(); |
728 | 743 |
729 // Drag-and-drop must be canceled prior to close all windows. | 744 // Drag-and-drop must be canceled prior to close all windows. |
730 drag_drop_controller_.reset(); | 745 drag_drop_controller_.reset(); |
731 | 746 |
732 // Controllers who have WindowObserver added must be deleted | 747 // Controllers who have WindowObserver added must be deleted |
733 // before |window_tree_host_manager_| is deleted. | 748 // before |window_tree_host_manager_| is deleted. |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 | 1185 |
1171 void Shell::OnWindowActivated( | 1186 void Shell::OnWindowActivated( |
1172 aura::client::ActivationChangeObserver::ActivationReason reason, | 1187 aura::client::ActivationChangeObserver::ActivationReason reason, |
1173 aura::Window* gained_active, | 1188 aura::Window* gained_active, |
1174 aura::Window* lost_active) { | 1189 aura::Window* lost_active) { |
1175 if (gained_active) | 1190 if (gained_active) |
1176 target_root_window_ = gained_active->GetRootWindow(); | 1191 target_root_window_ = gained_active->GetRootWindow(); |
1177 } | 1192 } |
1178 | 1193 |
1179 } // namespace ash | 1194 } // namespace ash |
OLD | NEW |