| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |