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

Unified Diff: ash/common/system/tray_accessibility.cc

Issue 2365523002: Materialized the font/icon color for some default rows in the system menu. (Closed)
Patch Set: Addressed tdanderson@ comments from previous patch set. Created 4 years, 3 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/common/system/tray/tray_popup_item_style_observer.h ('k') | ash/common/system/update/tray_update.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray_accessibility.cc
diff --git a/ash/common/system/tray_accessibility.cc b/ash/common/system/tray_accessibility.cc
index 273a93937a0aff907e732b51e109e1b83d867279..055ececc8f014f21f1eb3b138fd09b9ecbd5b005 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -15,6 +15,7 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_details_view.h"
#include "ash/common/system/tray/tray_item_more.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/system/tray/tray_popup_label_button.h"
#include "ash/common/wm_shell.h"
#include "ash/resources/vector_icons/vector_icons.h"
@@ -77,10 +78,8 @@ class DefaultAccessibilityView : public TrayItemMore {
explicit DefaultAccessibilityView(SystemTrayItem* owner)
: TrayItemMore(owner, true) {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
- SetImage(
- gfx::CreateVectorIcon(kSystemMenuAccessibilityIcon, kMenuIconColor));
- } else {
+ if (!MaterialDesignController::UseMaterialDesignSystemIcons()) {
+ // The icon doesn't change in non-md.
SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK)
.ToImageSkia());
}
@@ -93,6 +92,19 @@ class DefaultAccessibilityView : public TrayItemMore {
~DefaultAccessibilityView() override {}
+ protected:
+ // TrayItemMore:
+ void UpdateStyle() override {
+ TrayItemMore::UpdateStyle();
+
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ return;
+
+ std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
+ SetImage(gfx::CreateVectorIcon(kSystemMenuAccessibilityIcon,
+ style->GetForegroundColor()));
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView);
};
« no previous file with comments | « ash/common/system/tray/tray_popup_item_style_observer.h ('k') | ash/common/system/update/tray_update.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698