Chromium Code Reviews| 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..43b1afb98d58dd8afb8e0ab7b82ae4a081aa82f4 100644 |
| --- a/ash/common/system/chromeos/tray_tracing.cc |
| +++ b/ash/common/system/chromeos/tray_tracing.cc |
| @@ -41,13 +41,18 @@ class DefaultTracingView : public ActionableView { |
| 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( |
|
tdanderson
2017/02/01 23:01:52
I think |image_| can be made a non-member as well,
Evan Stade
2017/02/02 22:49:53
Done.
|
| + gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor())); |
| + |
| SetInkDropMode(InkDropHostView::InkDropMode::ON); |
| } else { |
| // The icon doesn't change in non-md. |
| @@ -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); |
| @@ -86,7 +73,6 @@ class DefaultTracingView : public ActionableView { |
| } |
| views::ImageView* image_; |
| - views::Label* label_; |
| DISALLOW_COPY_AND_ASSIGN(DefaultTracingView); |
| }; |