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

Unified Diff: ash/common/system/ime/tray_ime_chromeos.cc

Issue 2365523002: Materialized the font/icon color for some default rows in the system menu. (Closed)
Patch Set: Applied TrayPopupItemStyle to Network, SMS, Tracing, OS Update. 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
Index: ash/common/system/ime/tray_ime_chromeos.cc
diff --git a/ash/common/system/ime/tray_ime_chromeos.cc b/ash/common/system/ime/tray_ime_chromeos.cc
index 7cbd3d7e7332d202e7f235730c187f3e08c0d788..45a0bdd28e2e237dd2abfbecc9e9c172346f828d 100644
--- a/ash/common/system/ime/tray_ime_chromeos.cc
+++ b/ash/common/system/ime/tray_ime_chromeos.cc
@@ -17,6 +17,7 @@
#include "ash/common/system/tray/tray_details_view.h"
#include "ash/common/system/tray/tray_item_more.h"
#include "ash/common/system/tray/tray_item_view.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/system/tray_accessibility.h"
#include "ash/common/wm_shell.h"
@@ -88,6 +89,24 @@ class IMEDefaultView : public TrayItemMore {
SetAccessibleName(label);
}
+ protected:
+ // TrayItemMore:
+ std::unique_ptr<TrayPopupItemStyle> CreateStyle() const override {
+ return base::MakeUnique<TrayPopupItemStyle>(
+ GetNativeTheme(), TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ }
+
+ void UpdateStyle() override {
+ TrayItemMore::UpdateStyle();
+
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ return;
+
+ std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
+ SetImage(gfx::CreateVectorIcon(kSystemMenuKeyboardIcon,
+ style->GetForegroundColor()));
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(IMEDefaultView);
};

Powered by Google App Engine
This is Rietveld 408576698