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 | 9 |
10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ash/shelf/shelf_item_delegate.h" | 42 #include "ash/shelf/shelf_item_delegate.h" |
43 #include "ash/shelf/shelf_item_delegate_manager.h" | 43 #include "ash/shelf/shelf_item_delegate_manager.h" |
44 #include "ash/shelf/shelf_layout_manager.h" | 44 #include "ash/shelf/shelf_layout_manager.h" |
45 #include "ash/shelf/shelf_model.h" | 45 #include "ash/shelf/shelf_model.h" |
46 #include "ash/shelf/shelf_widget.h" | 46 #include "ash/shelf/shelf_widget.h" |
47 #include "ash/shelf/shelf_window_watcher.h" | 47 #include "ash/shelf/shelf_window_watcher.h" |
48 #include "ash/shell_delegate.h" | 48 #include "ash/shell_delegate.h" |
49 #include "ash/shell_factory.h" | 49 #include "ash/shell_factory.h" |
50 #include "ash/shell_window_ids.h" | 50 #include "ash/shell_window_ids.h" |
51 #include "ash/system/locale/locale_notification_controller.h" | 51 #include "ash/system/locale/locale_notification_controller.h" |
| 52 #include "ash/system/session/logout_confirmation_controller.h" |
52 #include "ash/system/status_area_widget.h" | 53 #include "ash/system/status_area_widget.h" |
53 #include "ash/system/tray/system_tray_delegate.h" | 54 #include "ash/system/tray/system_tray_delegate.h" |
54 #include "ash/system/tray/system_tray_notifier.h" | 55 #include "ash/system/tray/system_tray_notifier.h" |
55 #include "ash/wm/app_list_controller.h" | 56 #include "ash/wm/app_list_controller.h" |
56 #include "ash/wm/ash_focus_rules.h" | 57 #include "ash/wm/ash_focus_rules.h" |
57 #include "ash/wm/ash_native_cursor_manager.h" | 58 #include "ash/wm/ash_native_cursor_manager.h" |
58 #include "ash/wm/coordinate_conversion.h" | 59 #include "ash/wm/coordinate_conversion.h" |
59 #include "ash/wm/custom_frame_view_ash.h" | 60 #include "ash/wm/custom_frame_view_ash.h" |
60 #include "ash/wm/event_client_impl.h" | 61 #include "ash/wm/event_client_impl.h" |
61 #include "ash/wm/lock_state_controller.h" | 62 #include "ash/wm/lock_state_controller.h" |
(...skipping 11 matching lines...) Expand all Loading... |
73 #include "ash/wm/toplevel_window_event_handler.h" | 74 #include "ash/wm/toplevel_window_event_handler.h" |
74 #include "ash/wm/user_activity_detector.h" | 75 #include "ash/wm/user_activity_detector.h" |
75 #include "ash/wm/video_detector.h" | 76 #include "ash/wm/video_detector.h" |
76 #include "ash/wm/window_animations.h" | 77 #include "ash/wm/window_animations.h" |
77 #include "ash/wm/window_cycle_controller.h" | 78 #include "ash/wm/window_cycle_controller.h" |
78 #include "ash/wm/window_positioner.h" | 79 #include "ash/wm/window_positioner.h" |
79 #include "ash/wm/window_properties.h" | 80 #include "ash/wm/window_properties.h" |
80 #include "ash/wm/window_util.h" | 81 #include "ash/wm/window_util.h" |
81 #include "ash/wm/workspace_controller.h" | 82 #include "ash/wm/workspace_controller.h" |
82 #include "base/bind.h" | 83 #include "base/bind.h" |
| 84 #include "base/bind_helpers.h" |
83 #include "base/command_line.h" | 85 #include "base/command_line.h" |
84 #include "base/debug/trace_event.h" | 86 #include "base/debug/trace_event.h" |
85 #include "ui/aura/client/aura_constants.h" | 87 #include "ui/aura/client/aura_constants.h" |
86 #include "ui/aura/client/user_action_client.h" | 88 #include "ui/aura/client/user_action_client.h" |
87 #include "ui/aura/env.h" | 89 #include "ui/aura/env.h" |
88 #include "ui/aura/layout_manager.h" | 90 #include "ui/aura/layout_manager.h" |
89 #include "ui/aura/window.h" | 91 #include "ui/aura/window.h" |
90 #include "ui/aura/window_event_dispatcher.h" | 92 #include "ui/aura/window_event_dispatcher.h" |
91 #include "ui/base/ui_base_switches.h" | 93 #include "ui/base/ui_base_switches.h" |
92 #include "ui/compositor/layer.h" | 94 #include "ui/compositor/layer.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 // Destroy maximize window manager early on since it has some observers which | 661 // Destroy maximize window manager early on since it has some observers which |
660 // need to be removed. | 662 // need to be removed. |
661 maximize_mode_window_manager_.reset(); | 663 maximize_mode_window_manager_.reset(); |
662 | 664 |
663 // AppList needs to be released before shelf layout manager, which is | 665 // AppList needs to be released before shelf layout manager, which is |
664 // destroyed with shelf container in the loop below. However, app list | 666 // destroyed with shelf container in the loop below. However, app list |
665 // container is now on top of shelf container and released after it. | 667 // container is now on top of shelf container and released after it. |
666 // TODO(xiyuan): Move it back when app list container is no longer needed. | 668 // TODO(xiyuan): Move it back when app list container is no longer needed. |
667 app_list_controller_.reset(); | 669 app_list_controller_.reset(); |
668 | 670 |
| 671 // Destroy the LogoutConfirmationController before the SystemTrayDelegate. |
| 672 logout_confirmation_controller_.reset(); |
| 673 |
669 // Destroy SystemTrayDelegate before destroying the status area(s). | 674 // Destroy SystemTrayDelegate before destroying the status area(s). |
670 system_tray_delegate_->Shutdown(); | 675 system_tray_delegate_->Shutdown(); |
671 system_tray_delegate_.reset(); | 676 system_tray_delegate_.reset(); |
672 | 677 |
673 locale_notification_controller_.reset(); | 678 locale_notification_controller_.reset(); |
674 | 679 |
675 // Drag-and-drop must be canceled prior to close all windows. | 680 // Drag-and-drop must be canceled prior to close all windows. |
676 drag_drop_controller_.reset(); | 681 drag_drop_controller_.reset(); |
677 | 682 |
678 // Controllers who have WindowObserver added must be deleted | 683 // Controllers who have WindowObserver added must be deleted |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. | 967 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. |
963 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); | 968 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); |
964 DCHECK(system_tray_delegate_.get()); | 969 DCHECK(system_tray_delegate_.get()); |
965 | 970 |
966 locale_notification_controller_.reset( | 971 locale_notification_controller_.reset( |
967 new internal::LocaleNotificationController); | 972 new internal::LocaleNotificationController); |
968 | 973 |
969 // Initialize system_tray_delegate_ after StatusAreaWidget is created. | 974 // Initialize system_tray_delegate_ after StatusAreaWidget is created. |
970 system_tray_delegate_->Initialize(); | 975 system_tray_delegate_->Initialize(); |
971 | 976 |
| 977 // Create the LogoutConfirmationController after the SystemTrayDelegate. |
| 978 logout_confirmation_controller_.reset( |
| 979 new internal::LogoutConfirmationController( |
| 980 base::Bind(&SystemTrayDelegate::SignOut, |
| 981 base::Unretained(system_tray_delegate_.get())))); |
| 982 |
972 // TODO(oshima): Initialize all RootWindowControllers once, and | 983 // TODO(oshima): Initialize all RootWindowControllers once, and |
973 // initialize controller/delegates above when initializing the | 984 // initialize controller/delegates above when initializing the |
974 // primary root window controller. | 985 // primary root window controller. |
975 internal::RootWindowController::CreateForPrimaryDisplay( | 986 internal::RootWindowController::CreateForPrimaryDisplay( |
976 root_window->GetHost()); | 987 root_window->GetHost()); |
977 | 988 |
978 display_controller_->InitSecondaryDisplays(); | 989 display_controller_->InitSecondaryDisplays(); |
979 | 990 |
980 // It needs to be created after RootWindowController has been created | 991 // It needs to be created after RootWindowController has been created |
981 // (which calls OnWindowResized has been called, otherwise the | 992 // (which calls OnWindowResized has been called, otherwise the |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 //////////////////////////////////////////////////////////////////////////////// | 1113 //////////////////////////////////////////////////////////////////////////////// |
1103 // Shell, aura::client::ActivationChangeObserver implementation: | 1114 // Shell, aura::client::ActivationChangeObserver implementation: |
1104 | 1115 |
1105 void Shell::OnWindowActivated(aura::Window* gained_active, | 1116 void Shell::OnWindowActivated(aura::Window* gained_active, |
1106 aura::Window* lost_active) { | 1117 aura::Window* lost_active) { |
1107 if (gained_active) | 1118 if (gained_active) |
1108 target_root_window_ = gained_active->GetRootWindow(); | 1119 target_root_window_ = gained_active->GetRootWindow(); |
1109 } | 1120 } |
1110 | 1121 |
1111 } // namespace ash | 1122 } // namespace ash |
OLD | NEW |