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 12 matching lines...) Expand all Loading... | |
23 #include "ash/common/frame/custom_frame_view_ash.h" | 23 #include "ash/common/frame/custom_frame_view_ash.h" |
24 #include "ash/common/gpu_support.h" | 24 #include "ash/common/gpu_support.h" |
25 #include "ash/common/keyboard/keyboard_ui.h" | 25 #include "ash/common/keyboard/keyboard_ui.h" |
26 #include "ash/common/login_status.h" | 26 #include "ash/common/login_status.h" |
27 #include "ash/common/palette_delegate.h" | 27 #include "ash/common/palette_delegate.h" |
28 #include "ash/common/session/session_state_delegate.h" | 28 #include "ash/common/session/session_state_delegate.h" |
29 #include "ash/common/shelf/wm_shelf.h" | 29 #include "ash/common/shelf/wm_shelf.h" |
30 #include "ash/common/shell_delegate.h" | 30 #include "ash/common/shell_delegate.h" |
31 #include "ash/common/shell_observer.h" | 31 #include "ash/common/shell_observer.h" |
32 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h" | 32 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h" |
33 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" | |
33 #include "ash/common/system/chromeos/network/sms_observer.h" | 34 #include "ash/common/system/chromeos/network/sms_observer.h" |
34 #include "ash/common/system/chromeos/power/power_status.h" | 35 #include "ash/common/system/chromeos/power/power_status.h" |
35 #include "ash/common/system/status_area_widget.h" | 36 #include "ash/common/system/status_area_widget.h" |
36 #include "ash/common/system/toast/toast_manager.h" | 37 #include "ash/common/system/toast/toast_manager.h" |
37 #include "ash/common/system/tray/system_tray_delegate.h" | 38 #include "ash/common/system/tray/system_tray_delegate.h" |
38 #include "ash/common/wallpaper/wallpaper_controller.h" | 39 #include "ash/common/wallpaper/wallpaper_controller.h" |
39 #include "ash/common/wallpaper/wallpaper_delegate.h" | 40 #include "ash/common/wallpaper/wallpaper_delegate.h" |
40 #include "ash/common/wm/container_finder.h" | 41 #include "ash/common/wm/container_finder.h" |
41 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 42 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
42 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 43 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 // Destroy the keyboard before closing the shelf, since it will invoke a shelf | 584 // Destroy the keyboard before closing the shelf, since it will invoke a shelf |
584 // layout. | 585 // layout. |
585 DeactivateKeyboard(); | 586 DeactivateKeyboard(); |
586 | 587 |
587 toast_manager_.reset(); | 588 toast_manager_.reset(); |
588 | 589 |
589 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure | 590 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure |
590 // to deinitialize the shelf first, as it is initialized after the delegate. | 591 // to deinitialize the shelf first, as it is initialized after the delegate. |
591 for (WmWindow* root : wm_shell_->GetAllRootWindows()) | 592 for (WmWindow* root : wm_shell_->GetAllRootWindows()) |
592 root->GetRootWindowController()->GetShelf()->ShutdownShelfWidget(); | 593 root->GetRootWindowController()->GetShelf()->ShutdownShelfWidget(); |
594 tray_bluetooth_helper_.reset(); | |
James Cook
2017/03/20 23:27:09
The timing of bluetooth adapter init/shutdown is n
msw
2017/03/20 23:47:07
Acknowledged.
| |
593 wm_shell_->DeleteSystemTrayDelegate(); | 595 wm_shell_->DeleteSystemTrayDelegate(); |
594 | 596 |
595 // Drag-and-drop must be canceled prior to close all windows. | 597 // Drag-and-drop must be canceled prior to close all windows. |
596 drag_drop_controller_.reset(); | 598 drag_drop_controller_.reset(); |
597 | 599 |
598 // Controllers who have WindowObserver added must be deleted | 600 // Controllers who have WindowObserver added must be deleted |
599 // before |window_tree_host_manager_| is deleted. | 601 // before |window_tree_host_manager_| is deleted. |
600 | 602 |
601 // VideoActivityNotifier must be deleted before |video_detector_| is | 603 // VideoActivityNotifier must be deleted before |video_detector_| is |
602 // deleted because it's observing video activity through | 604 // deleted because it's observing video activity through |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 // Must occur after Shell has installed its early pre-target handlers (for | 949 // Must occur after Shell has installed its early pre-target handlers (for |
948 // example, WindowModalityController). | 950 // example, WindowModalityController). |
949 wm_shell_->CreatePointerWatcherAdapter(); | 951 wm_shell_->CreatePointerWatcherAdapter(); |
950 | 952 |
951 resize_shadow_controller_.reset(new ResizeShadowController()); | 953 resize_shadow_controller_.reset(new ResizeShadowController()); |
952 shadow_controller_.reset(new ::wm::ShadowController(focus_controller_.get())); | 954 shadow_controller_.reset(new ::wm::ShadowController(focus_controller_.get())); |
953 | 955 |
954 wm_shell_->SetSystemTrayDelegate( | 956 wm_shell_->SetSystemTrayDelegate( |
955 base::WrapUnique(shell_delegate_->CreateSystemTrayDelegate())); | 957 base::WrapUnique(shell_delegate_->CreateSystemTrayDelegate())); |
956 | 958 |
959 tray_bluetooth_helper_ = base::MakeUnique<TrayBluetoothHelper>(); | |
960 tray_bluetooth_helper_->Initialize(); | |
msw
2017/03/20 23:47:07
Can we move instantiation to the ctor, or combine
James Cook
2017/03/21 00:18:08
Moved instantiation to the ctor.
| |
961 | |
957 // Create AshTouchTransformController before | 962 // Create AshTouchTransformController before |
958 // WindowTreeHostManager::InitDisplays() | 963 // WindowTreeHostManager::InitDisplays() |
959 // since AshTouchTransformController listens on | 964 // since AshTouchTransformController listens on |
960 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 965 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
961 if (!is_mash) { | 966 if (!is_mash) { |
962 touch_transformer_controller_.reset(new AshTouchTransformController( | 967 touch_transformer_controller_.reset(new AshTouchTransformController( |
963 display_configurator_.get(), display_manager_.get())); | 968 display_configurator_.get(), display_manager_.get())); |
964 } | 969 } |
965 | 970 |
966 if (!is_mash) | 971 if (!is_mash) |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1096 void Shell::OnWindowActivated( | 1101 void Shell::OnWindowActivated( |
1097 aura::client::ActivationChangeObserver::ActivationReason reason, | 1102 aura::client::ActivationChangeObserver::ActivationReason reason, |
1098 aura::Window* gained_active, | 1103 aura::Window* gained_active, |
1099 aura::Window* lost_active) { | 1104 aura::Window* lost_active) { |
1100 WmWindow* gained_active_wm = WmWindow::Get(gained_active); | 1105 WmWindow* gained_active_wm = WmWindow::Get(gained_active); |
1101 if (gained_active_wm) | 1106 if (gained_active_wm) |
1102 root_window_for_new_windows_ = gained_active_wm->GetRootWindow(); | 1107 root_window_for_new_windows_ = gained_active_wm->GetRootWindow(); |
1103 } | 1108 } |
1104 | 1109 |
1105 } // namespace ash | 1110 } // namespace ash |
OLD | NEW |