Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1442)

Unified Diff: ash/shell.cc

Issue 2921973002: Hide Night Light behind a flag (Closed)
Patch Set: James' comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/system/night_light/night_light_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « ash/shell.h ('k') | ash/system/night_light/night_light_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698