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

Unified Diff: ash/system/tiles/tiles_default_view.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/system/night_light/tray_night_light_unittest.cc ('k') | ash/system/tiles/tray_tiles_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tiles/tiles_default_view.cc
diff --git a/ash/system/tiles/tiles_default_view.cc b/ash/system/tiles/tiles_default_view.cc
index dbb5fd4bf28fb12f7df427cfc16433af4563a08a..6a47922009e57f82dcec02116f36cc3ca0533c85 100644
--- a/ash/system/tiles/tiles_default_view.cc
+++ b/ash/system/tiles/tiles_default_view.cc
@@ -86,10 +86,12 @@ void TilesDefaultView::Init() {
AddChildView(help_button_);
AddChildView(TrayPopupUtils::CreateVerticalSeparator());
- night_light_button_ = new NightLightToggleButton(this);
- night_light_button_->SetEnabled(can_show_web_ui);
- AddChildView(night_light_button_);
- AddChildView(TrayPopupUtils::CreateVerticalSeparator());
+ if (NightLightController::IsFeatureEnabled()) {
+ night_light_button_ = new NightLightToggleButton(this);
+ night_light_button_->SetEnabled(can_show_web_ui);
+ AddChildView(night_light_button_);
+ AddChildView(TrayPopupUtils::CreateVerticalSeparator());
+ }
lock_button_ =
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
@@ -120,7 +122,8 @@ void TilesDefaultView::ButtonPressed(views::Button* sender,
} else if (sender == help_button_) {
ShellPort::Get()->RecordUserMetricsAction(UMA_TRAY_HELP);
Shell::Get()->system_tray_controller()->ShowHelp();
- } else if (sender == night_light_button_) {
+ } else if (NightLightController::IsFeatureEnabled() &&
+ sender == night_light_button_) {
ShellPort::Get()->RecordUserMetricsAction(UMA_TRAY_NIGHT_LIGHT);
Shell::Get()->night_light_controller()->Toggle();
night_light_button_->Update();
« no previous file with comments | « ash/system/night_light/tray_night_light_unittest.cc ('k') | ash/system/tiles/tray_tiles_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698