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

Side by Side Diff: ash/common/system/update/tray_update.cc

Issue 2468173003: Fixed ugly text in the material design system menu. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/update/tray_update.h" 5 #include "ash/common/system/update/tray_update.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/metrics/user_metrics_action.h" 8 #include "ash/common/metrics/user_metrics_action.h"
9 #include "ash/common/system/tray/fixed_sized_image_view.h" 9 #include "ash/common/system/tray/fixed_sized_image_view.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
11 #include "ash/common/system/tray/system_tray_delegate.h" 11 #include "ash/common/system/tray/system_tray_delegate.h"
12 #include "ash/common/system/tray/system_tray_notifier.h" 12 #include "ash/common/system/tray/system_tray_notifier.h"
13 #include "ash/common/system/tray/tray_constants.h" 13 #include "ash/common/system/tray/tray_constants.h"
14 #include "ash/common/system/tray/tray_popup_item_style.h" 14 #include "ash/common/system/tray/tray_popup_item_style.h"
15 #include "ash/common/system/tray/tray_popup_utils.h"
15 #include "ash/common/wm_shell.h" 16 #include "ash/common/wm_shell.h"
16 #include "ash/resources/vector_icons/vector_icons.h" 17 #include "ash/resources/vector_icons/vector_icons.h"
17 #include "grit/ash_resources.h" 18 #include "grit/ash_resources.h"
18 #include "grit/ash_strings.h" 19 #include "grit/ash_strings.h"
19 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
20 #include "ui/gfx/color_palette.h" 21 #include "ui/gfx/color_palette.h"
21 #include "ui/gfx/image/image.h" 22 #include "ui/gfx/image/image.h"
22 #include "ui/gfx/paint_vector_icon.h" 23 #include "ui/gfx/paint_vector_icon.h"
23 #include "ui/views/controls/image_view.h" 24 #include "ui/views/controls/image_view.h"
24 #include "ui/views/controls/label.h" 25 #include "ui/views/controls/label.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 image->SetImage(bundle.GetImageNamed(DecideResource(info.severity, true)) 99 image->SetImage(bundle.GetImageNamed(DecideResource(info.severity, true))
99 .ToImageSkia()); 100 .ToImageSkia());
100 } 101 }
101 AddChildView(image); 102 AddChildView(image);
102 103
103 base::string16 label_text = 104 base::string16 label_text =
104 info.factory_reset_required 105 info.factory_reset_required
105 ? bundle.GetLocalizedString( 106 ? bundle.GetLocalizedString(
106 IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE) 107 IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE)
107 : bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE); 108 : bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE);
108 label_ = new views::Label(label_text); 109 label_ = TrayPopupUtils::CreateDefaultLabel();
110 label_->SetText(label_text);
109 AddChildView(label_); 111 AddChildView(label_);
110 SetAccessibleName(label_text); 112 SetAccessibleName(label_text);
111 113
112 if (MaterialDesignController::IsSystemTrayMenuMaterial()) 114 if (MaterialDesignController::IsSystemTrayMenuMaterial())
113 SetInkDropMode(InkDropHostView::InkDropMode::ON); 115 SetInkDropMode(InkDropHostView::InkDropMode::ON);
114 } 116 }
115 117
116 ~UpdateView() override {} 118 ~UpdateView() override {}
117 119
118 private: 120 private:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 168
167 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { 169 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) {
168 if (MaterialDesignController::UseMaterialDesignSystemIcons()) 170 if (MaterialDesignController::UseMaterialDesignSystemIcons())
169 SetIconColor(IconColorForUpdateSeverity(info.severity, false)); 171 SetIconColor(IconColorForUpdateSeverity(info.severity, false));
170 else 172 else
171 SetImageFromResourceId(DecideResource(info.severity, false)); 173 SetImageFromResourceId(DecideResource(info.severity, false));
172 tray_view()->SetVisible(true); 174 tray_view()->SetVisible(true);
173 } 175 }
174 176
175 } // namespace ash 177 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698