| 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 581149bfb54a534c27391e5573070087d7bd4843..3663e0f68187dd59ecc873e810ae353d0c82d5ad 100644
|
| --- a/ash/common/system/chromeos/tray_tracing.cc
|
| +++ b/ash/common/system/chromeos/tray_tracing.cc
|
| @@ -38,20 +38,25 @@ class DefaultTracingView : public ActionableView {
|
| SetLayoutManager(new views::FillLayout);
|
| TriView* tri_view = TrayPopupUtils::CreateDefaultRowView();
|
| AddChildView(tri_view);
|
| - image_ = TrayPopupUtils::CreateMainImageView();
|
| - tri_view->AddView(TriView::Container::START, image_);
|
| + auto image = TrayPopupUtils::CreateMainImageView();
|
| + tri_view->AddView(TriView::Container::START, image);
|
|
|
| - label_ = TrayPopupUtils::CreateDefaultLabel();
|
| - label_->SetMultiLine(true);
|
| - label_->SetText(bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_TRACING));
|
| - tri_view->AddView(TriView::Container::CENTER, label_);
|
| + auto label = TrayPopupUtils::CreateDefaultLabel();
|
| + label->SetMultiLine(true);
|
| + label->SetText(bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_TRACING));
|
| + tri_view->AddView(TriView::Container::CENTER, label);
|
|
|
| if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
|
| - UpdateStyle();
|
| + TrayPopupItemStyle style(
|
| + TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
|
| + style.SetupLabel(label);
|
| + image->SetImage(
|
| + gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor()));
|
| +
|
| SetInkDropMode(InkDropHostView::InkDropMode::ON);
|
| } else {
|
| // The icon doesn't change in non-md.
|
| - image_->SetImage(
|
| + image->SetImage(
|
| bundle.GetImageNamed(IDR_AURA_UBER_TRAY_TRACING).ToImageSkia());
|
| }
|
| }
|
| @@ -59,24 +64,6 @@ class DefaultTracingView : public ActionableView {
|
| ~DefaultTracingView() override {}
|
|
|
| private:
|
| - // Update text and image color based on the current theme of the system.
|
| - void UpdateStyle() {
|
| - TrayPopupItemStyle style(GetNativeTheme(),
|
| - TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
|
| - style.SetupLabel(label_);
|
| - image_->SetImage(
|
| - gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor()));
|
| - }
|
| -
|
| - // ActionableView:
|
| - void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
|
| - ActionableView::OnNativeThemeChanged(theme);
|
| -
|
| - if (!MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| - UpdateStyle();
|
| - }
|
| -
|
| bool PerformAction(const ui::Event& event) override {
|
| WmShell::Get()->RecordUserMetricsAction(
|
| UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED);
|
| @@ -85,9 +72,6 @@ class DefaultTracingView : public ActionableView {
|
| return true;
|
| }
|
|
|
| - views::ImageView* image_;
|
| - views::Label* label_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(DefaultTracingView);
|
| };
|
|
|
|
|