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

Unified Diff: ash/common/system/chromeos/tray_tracing.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/chromeos/tray_tracing.cc
diff --git a/ash/common/system/chromeos/tray_tracing.cc b/ash/common/system/chromeos/tray_tracing.cc
index e1ac45f5d5a4814487c187c1867c9a67670eb65a..327c4c3dc1a10c8f1e35100e7b18cb4535e16775 100644
--- a/ash/common/system/chromeos/tray_tracing.cc
+++ b/ash/common/system/chromeos/tray_tracing.cc
@@ -12,6 +12,7 @@
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/tray/tray_constants.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/wm_shell.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
@@ -36,12 +37,8 @@ class DefaultTracingView : public ActionableView {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
image_ =
new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT));
- if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
- // TODO(tdanderson): Update the icon used for tracing or remove it from
- // the system menu. See crbug.com/625691.
- image_->SetImage(CreateVectorIcon(gfx::VectorIconId::CODE, kMenuIconSize,
- kMenuIconColor));
- } else {
+ if (!MaterialDesignController::UseMaterialDesignSystemIcons()) {
+ // The icon doesn't change in non-md.
image_->SetImage(
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_TRACING).ToImageSkia());
}
@@ -57,7 +54,23 @@ class DefaultTracingView : public ActionableView {
~DefaultTracingView() override {}
private:
- // Overridden from ActionableView.
+ // ActionableView:
+ void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
+ ActionableView::OnNativeThemeChanged(theme);
+
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ return;
+
+ TrayPopupItemStyle style(GetNativeTheme(),
+ TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ style.SetupLabel(label_);
+
+ // TODO(tdanderson): Update the icon used for tracing or remove it from
+ // the system menu. See crbug.com/625691.
+ image_->SetImage(CreateVectorIcon(gfx::VectorIconId::CODE, kMenuIconSize,
+ style.GetForegroundColor()));
+ }
+
bool PerformAction(const ui::Event& event) override {
WmShell::Get()->RecordUserMetricsAction(
UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED);

Powered by Google App Engine
This is Rietveld 408576698