Commit 8ad58076 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Hide Night Light button when not logged in.

Night Light button is no-op when not logged in. There's no harm but it's
better to hide the button to avoid confusion.

TEST=manual
BUG=819957

Change-Id: I28fa1629dea1c19340d6eabcb1bca51b1fea28f0
Reviewed-on: https://chromium-review.googlesource.com/1107533Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569122}
parent 176b7c06
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/session/session_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/system/night_light/night_light_controller.h" #include "ash/system/night_light/night_light_controller.h"
...@@ -21,7 +22,9 @@ NightLightFeaturePodController::~NightLightFeaturePodController() = default; ...@@ -21,7 +22,9 @@ NightLightFeaturePodController::~NightLightFeaturePodController() = default;
FeaturePodButton* NightLightFeaturePodController::CreateButton() { FeaturePodButton* NightLightFeaturePodController::CreateButton() {
DCHECK(!button_); DCHECK(!button_);
button_ = new FeaturePodButton(this); button_ = new FeaturePodButton(this);
button_->SetVisible(features::IsNightLightEnabled()); button_->SetVisible(
features::IsNightLightEnabled() &&
Shell::Get()->session_controller()->ShouldEnableSettings());
button_->SetLabel( button_->SetLabel(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_BUTTON_LABEL)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_BUTTON_LABEL));
UpdateButton(); UpdateButton();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment