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

Unified Diff: ash/system/tiles/tiles_default_view.cc

Issue 2907503002: Use correct theme for the off icon of NightLight, fix tooltip and a11y (Closed)
Patch Set: Expose button for tests. 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
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 b67d34e8f7c7892197edd54d860fa00eb9eb8a08..dbb5fd4bf28fb12f7df427cfc16433af4563a08a 100644
--- a/ash/system/tiles/tiles_default_view.cc
+++ b/ash/system/tiles/tiles_default_view.cc
@@ -12,6 +12,7 @@
#include "ash/shutdown_controller.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/system/night_light/night_light_controller.h"
+#include "ash/system/night_light/night_light_toggle_button.h"
#include "ash/system/tray/system_menu_button.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_controller.h"
@@ -36,12 +37,6 @@ namespace {
// not mirrored in this locale.
const char kHebrewLocale[] = "he";
-const gfx::VectorIcon& GetNightLightButtonIcon() {
- return Shell::Get()->night_light_controller()->GetEnabled()
- ? kSystemMenuNightLightOnIcon
- : kSystemMenuNightLightOffIcon;
-}
-
} // namespace
TilesDefaultView::TilesDefaultView(SystemTrayItem* owner)
@@ -91,9 +86,7 @@ void TilesDefaultView::Init() {
AddChildView(help_button_);
AddChildView(TrayPopupUtils::CreateVerticalSeparator());
- night_light_button_ = new SystemMenuButton(
- this, TrayPopupInkDropStyle::HOST_CENTERED, GetNightLightButtonIcon(),
- IDS_ASH_STATUS_TRAY_NIGHT_LIGHT);
+ night_light_button_ = new NightLightToggleButton(this);
night_light_button_->SetEnabled(can_show_web_ui);
AddChildView(night_light_button_);
AddChildView(TrayPopupUtils::CreateVerticalSeparator());
@@ -130,7 +123,7 @@ void TilesDefaultView::ButtonPressed(views::Button* sender,
} else if (sender == night_light_button_) {
ShellPort::Get()->RecordUserMetricsAction(UMA_TRAY_NIGHT_LIGHT);
Shell::Get()->night_light_controller()->Toggle();
- night_light_button_->SetVectorIcon(GetNightLightButtonIcon());
+ night_light_button_->Update();
} else if (sender == lock_button_) {
ShellPort::Get()->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN);
chromeos::DBusThreadManager::Get()

Powered by Google App Engine
This is Rietveld 408576698