| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "ash/sticky_keys/sticky_keys_controller.h" | 66 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 67 #include "ash/system/bluetooth/bluetooth_notification_controller.h" | 67 #include "ash/system/bluetooth/bluetooth_notification_controller.h" |
| 68 #include "ash/system/bluetooth/tray_bluetooth_helper.h" | 68 #include "ash/system/bluetooth/tray_bluetooth_helper.h" |
| 69 #include "ash/system/brightness/brightness_controller_chromeos.h" | 69 #include "ash/system/brightness/brightness_controller_chromeos.h" |
| 70 #include "ash/system/brightness_control_delegate.h" | 70 #include "ash/system/brightness_control_delegate.h" |
| 71 #include "ash/system/keyboard_brightness_control_delegate.h" | 71 #include "ash/system/keyboard_brightness_control_delegate.h" |
| 72 #include "ash/system/keyboard_brightness_controller.h" | 72 #include "ash/system/keyboard_brightness_controller.h" |
| 73 #include "ash/system/locale/locale_notification_controller.h" | 73 #include "ash/system/locale/locale_notification_controller.h" |
| 74 #include "ash/system/network/sms_observer.h" | 74 #include "ash/system/network/sms_observer.h" |
| 75 #include "ash/system/network/vpn_list.h" | 75 #include "ash/system/network/vpn_list.h" |
| 76 #include "ash/system/night_light/night_light_controller.h" | |
| 77 #include "ash/system/power/power_event_observer.h" | 76 #include "ash/system/power/power_event_observer.h" |
| 78 #include "ash/system/power/power_status.h" | 77 #include "ash/system/power/power_status.h" |
| 79 #include "ash/system/power/video_activity_notifier.h" | 78 #include "ash/system/power/video_activity_notifier.h" |
| 80 #include "ash/system/screen_layout_observer.h" | 79 #include "ash/system/screen_layout_observer.h" |
| 81 #include "ash/system/session/logout_confirmation_controller.h" | 80 #include "ash/system/session/logout_confirmation_controller.h" |
| 82 #include "ash/system/status_area_widget.h" | 81 #include "ash/system/status_area_widget.h" |
| 83 #include "ash/system/toast/toast_manager.h" | 82 #include "ash/system/toast/toast_manager.h" |
| 84 #include "ash/system/tray/system_tray_controller.h" | 83 #include "ash/system/tray/system_tray_controller.h" |
| 85 #include "ash/system/tray/system_tray_delegate.h" | 84 #include "ash/system/tray/system_tray_delegate.h" |
| 86 #include "ash/system/tray/system_tray_notifier.h" | 85 #include "ash/system/tray/system_tray_notifier.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 focus_cycler_(base::MakeUnique<FocusCycler>()), | 553 focus_cycler_(base::MakeUnique<FocusCycler>()), |
| 555 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), | 554 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), |
| 556 keyboard_brightness_control_delegate_( | 555 keyboard_brightness_control_delegate_( |
| 557 base::MakeUnique<KeyboardBrightnessController>()), | 556 base::MakeUnique<KeyboardBrightnessController>()), |
| 558 locale_notification_controller_( | 557 locale_notification_controller_( |
| 559 base::MakeUnique<LocaleNotificationController>()), | 558 base::MakeUnique<LocaleNotificationController>()), |
| 560 lock_screen_controller_(base::MakeUnique<LockScreenController>()), | 559 lock_screen_controller_(base::MakeUnique<LockScreenController>()), |
| 561 media_controller_(base::MakeUnique<MediaController>()), | 560 media_controller_(base::MakeUnique<MediaController>()), |
| 562 new_window_controller_(base::MakeUnique<NewWindowController>()), | 561 new_window_controller_(base::MakeUnique<NewWindowController>()), |
| 563 session_controller_(base::MakeUnique<SessionController>()), | 562 session_controller_(base::MakeUnique<SessionController>()), |
| 564 night_light_controller_( | |
| 565 base::MakeUnique<NightLightController>(session_controller_.get())), | |
| 566 shelf_controller_(base::MakeUnique<ShelfController>()), | 563 shelf_controller_(base::MakeUnique<ShelfController>()), |
| 567 shell_delegate_(std::move(shell_delegate)), | 564 shell_delegate_(std::move(shell_delegate)), |
| 568 shutdown_controller_(base::MakeUnique<ShutdownController>()), | 565 shutdown_controller_(base::MakeUnique<ShutdownController>()), |
| 569 system_tray_controller_(base::MakeUnique<SystemTrayController>()), | 566 system_tray_controller_(base::MakeUnique<SystemTrayController>()), |
| 570 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), | 567 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), |
| 571 tray_action_(base::MakeUnique<TrayAction>()), | 568 tray_action_(base::MakeUnique<TrayAction>()), |
| 572 vpn_list_(base::MakeUnique<VpnList>()), | 569 vpn_list_(base::MakeUnique<VpnList>()), |
| 573 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), | 570 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), |
| 574 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), | 571 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), |
| 575 app_list_(base::MakeUnique<app_list::AppList>()), | 572 app_list_(base::MakeUnique<app_list::AppList>()), |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 pref_service_ = nullptr; | 780 pref_service_ = nullptr; |
| 784 shell_delegate_.reset(); | 781 shell_delegate_.reset(); |
| 785 | 782 |
| 786 DCHECK(instance_ == this); | 783 DCHECK(instance_ == this); |
| 787 instance_ = nullptr; | 784 instance_ = nullptr; |
| 788 } | 785 } |
| 789 | 786 |
| 790 void Shell::Init(const ShellInitParams& init_params) { | 787 void Shell::Init(const ShellInitParams& init_params) { |
| 791 const Config config = shell_port_->GetAshConfig(); | 788 const Config config = shell_port_->GetAshConfig(); |
| 792 | 789 |
| 790 if (NightLightController::IsFeatureEnabled()) { |
| 791 night_light_controller_ = |
| 792 base::MakeUnique<NightLightController>(session_controller_.get()); |
| 793 } |
| 794 |
| 793 blocking_pool_ = init_params.blocking_pool; | 795 blocking_pool_ = init_params.blocking_pool; |
| 794 | 796 |
| 795 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); | 797 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); |
| 796 | 798 |
| 797 // Can be null in tests. | 799 // Can be null in tests. |
| 798 if (config == Config::MASH && shell_delegate_->GetShellConnector()) { | 800 if (config == Config::MASH && shell_delegate_->GetShellConnector()) { |
| 799 auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>(); | 801 auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>(); |
| 800 Shell::RegisterPrefs(pref_registry.get()); | 802 Shell::RegisterPrefs(pref_registry.get()); |
| 801 prefs::ConnectToPrefService( | 803 prefs::ConnectToPrefService( |
| 802 shell_delegate_->GetShellConnector(), std::move(pref_registry), {}, | 804 shell_delegate_->GetShellConnector(), std::move(pref_registry), {}, |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 void Shell::OnPrefServiceInitialized( | 1261 void Shell::OnPrefServiceInitialized( |
| 1260 std::unique_ptr<::PrefService> pref_service) { | 1262 std::unique_ptr<::PrefService> pref_service) { |
| 1261 if (!instance_) | 1263 if (!instance_) |
| 1262 return; | 1264 return; |
| 1263 // |pref_service_| is null if can't connect to Chrome (as happens when | 1265 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1264 // running mash outside of chrome --mash and chrome isn't built). | 1266 // running mash outside of chrome --mash and chrome isn't built). |
| 1265 pref_service_ = std::move(pref_service); | 1267 pref_service_ = std::move(pref_service); |
| 1266 } | 1268 } |
| 1267 | 1269 |
| 1268 } // namespace ash | 1270 } // namespace ash |
| OLD | NEW |