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

Unified Diff: ash/common/system/update/tray_update.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_accessibility.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/update/tray_update.cc
diff --git a/ash/common/system/update/tray_update.cc b/ash/common/system/update/tray_update.cc
index 42666496ef8770a2b5c9f059fe9c1d75a6ced018..15a0f48b6aaefc8a40fd0a728653d536edd51439 100644
--- a/ash/common/system/update/tray_update.cc
+++ b/ash/common/system/update/tray_update.cc
@@ -11,6 +11,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 "ash/resources/vector_icons/vector_icons.h"
#include "grit/ash_resources.h"
@@ -80,7 +81,7 @@ SkColor IconColorForUpdateSeverity(UpdateInfo::UpdateSeverity severity,
class UpdateView : public ActionableView {
public:
- explicit UpdateView(const UpdateInfo& info) {
+ explicit UpdateView(const UpdateInfo& info) : label_(nullptr) {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
kTrayPopupPaddingHorizontal, 0,
kTrayPopupPaddingBetweenItems));
@@ -98,13 +99,14 @@ class UpdateView : public ActionableView {
}
AddChildView(image);
- base::string16 label =
+ base::string16 label_text =
info.factory_reset_required
? bundle.GetLocalizedString(
IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE)
: bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE);
- AddChildView(new views::Label(label));
- SetAccessibleName(label);
+ label_ = new views::Label(label_text);
+ AddChildView(label_);
+ SetAccessibleName(label_text);
}
~UpdateView() override {}
@@ -118,6 +120,19 @@ class UpdateView : public ActionableView {
return true;
}
+ 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_);
+ }
+
+ views::Label* label_;
+
DISALLOW_COPY_AND_ASSIGN(UpdateView);
};
« no previous file with comments | « ash/common/system/tray_accessibility.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698