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

Unified Diff: ash/system/tray/system_menu_button.cc

Issue 2884323002: Leave ChromeOS system menu open when toggling nightlight. (Closed)
Patch Set: fix messed up include 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/tray/system_menu_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_menu_button.cc
diff --git a/ash/system/tray/system_menu_button.cc b/ash/system/tray/system_menu_button.cc
index cca6f654d19dd37d29400ff5aa5a189554e46ffd..48936379d465eb85745a1126074a22e67369562c 100644
--- a/ash/system/tray/system_menu_button.cc
+++ b/ash/system/tray/system_menu_button.cc
@@ -21,15 +21,15 @@ namespace ash {
SystemMenuButton::SystemMenuButton(views::ButtonListener* listener,
TrayPopupInkDropStyle ink_drop_style,
- gfx::ImageSkia normal_icon,
- gfx::ImageSkia disabled_icon,
+ const gfx::ImageSkia& normal_icon,
+ const gfx::ImageSkia& disabled_icon,
int accessible_name_id)
: views::ImageButton(listener), ink_drop_style_(ink_drop_style) {
DCHECK_EQ(normal_icon.width(), disabled_icon.width());
DCHECK_EQ(normal_icon.height(), disabled_icon.height());
- SetImage(STATE_NORMAL, &normal_icon);
- SetImage(STATE_DISABLED, &disabled_icon);
+ SetImage(STATE_NORMAL, normal_icon);
+ SetImage(STATE_DISABLED, disabled_icon);
SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
set_preferred_size(gfx::Size(kMenuButtonSize, kMenuButtonSize));
@@ -46,9 +46,18 @@ SystemMenuButton::SystemMenuButton(views::ButtonListener* listener,
int accessible_name_id)
: SystemMenuButton(listener,
ink_drop_style,
- gfx::CreateVectorIcon(icon, kMenuIconColor),
- gfx::CreateVectorIcon(icon, kMenuIconColorDisabled),
- accessible_name_id) {}
+ gfx::ImageSkia(),
+ gfx::ImageSkia(),
+ accessible_name_id) {
+ SetVectorIcon(icon);
+}
+
+void SystemMenuButton::SetVectorIcon(const gfx::VectorIcon& icon) {
+ SetImage(views::Button::STATE_NORMAL,
+ gfx::CreateVectorIcon(icon, kMenuIconColor));
+ SetImage(views::Button::STATE_DISABLED,
+ gfx::CreateVectorIcon(icon, kMenuIconColorDisabled));
+}
SystemMenuButton::~SystemMenuButton() {}
« no previous file with comments | « ash/system/tray/system_menu_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698