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

Unified Diff: ash/common/system/chromeos/tray_tracing.cc

Issue 2661023006: Remove unused references to NativeTheme in TrayPopupItemStyle. (Closed)
Patch Set: slight improvement Created 3 years, 11 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/chromeos/tray_caps_lock.cc ('k') | ash/common/system/date/date_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ash/common/system/chromeos/tray_caps_lock.cc ('k') | ash/common/system/date/date_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698