| 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);
|
| };
|
|
|
|
|