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

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

Issue 2661023006: Remove unused references to NativeTheme in TrayPopupItemStyle. (Closed)
Patch Set: inline/share more 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698