Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 1c72b473fa635c9caca4677b29d17a70ea5cb317..bb5aad514a8e07aa56e5118c68002defbb0b84d3 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -373,6 +373,11 @@ bool Shell::ShouldSaveDisplaySettings() { |
resolution_notification_controller_->DoesNotificationTimeout()); |
} |
+NightLightController* Shell::night_light_controller() { |
+ DCHECK(NightLightController::IsFeatureEnabled()); |
+ return night_light_controller_.get(); |
+} |
+ |
ShelfModel* Shell::shelf_model() { |
return shelf_controller_->model(); |
} |
@@ -561,8 +566,6 @@ Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate, |
media_controller_(base::MakeUnique<MediaController>()), |
new_window_controller_(base::MakeUnique<NewWindowController>()), |
session_controller_(base::MakeUnique<SessionController>()), |
- night_light_controller_( |
- base::MakeUnique<NightLightController>(session_controller_.get())), |
shelf_controller_(base::MakeUnique<ShelfController>()), |
shell_delegate_(std::move(shell_delegate)), |
shutdown_controller_(base::MakeUnique<ShutdownController>()), |
@@ -790,6 +793,11 @@ Shell::~Shell() { |
void Shell::Init(const ShellInitParams& init_params) { |
const Config config = shell_port_->GetAshConfig(); |
+ if (NightLightController::IsFeatureEnabled()) { |
+ night_light_controller_ = |
+ base::MakeUnique<NightLightController>(session_controller_.get()); |
+ } |
+ |
blocking_pool_ = init_params.blocking_pool; |
wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); |