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

Side by Side Diff: ash/common/system/chromeos/settings/tray_settings.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 | « no previous file | ash/common/system/chromeos/tray_caps_lock.cc » ('j') | 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/chromeos/settings/tray_settings.h" 5 #include "ash/common/system/chromeos/settings/tray_settings.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/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/system/chromeos/power/power_status.h" 9 #include "ash/common/system/chromeos/power/power_status.h"
10 #include "ash/common/system/chromeos/power/power_status_view.h" 10 #include "ash/common/system/chromeos/power/power_status_view.h"
11 #include "ash/common/system/tray/actionable_view.h" 11 #include "ash/common/system/tray/actionable_view.h"
12 #include "ash/common/system/tray/fixed_sized_image_view.h" 12 #include "ash/common/system/tray/fixed_sized_image_view.h"
13 #include "ash/common/system/tray/system_tray_controller.h" 13 #include "ash/common/system/tray/system_tray_controller.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/system/tray/tray_constants.h" 15 #include "ash/common/system/tray/tray_constants.h"
16 #include "ash/common/system/tray/tray_popup_utils.h"
16 #include "ash/common/wm_shell.h" 17 #include "ash/common/wm_shell.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "grit/ash_resources.h" 20 #include "grit/ash_resources.h"
20 #include "grit/ash_strings.h" 21 #include "grit/ash_strings.h"
21 #include "third_party/skia/include/core/SkColor.h" 22 #include "third_party/skia/include/core/SkColor.h"
22 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
23 #include "ui/gfx/image/image.h" 24 #include "ui/gfx/image/image.h"
24 #include "ui/views/controls/image_view.h" 25 #include "ui/views/controls/image_view.h"
25 #include "ui/views/controls/label.h" 26 #include "ui/views/controls/label.h"
(...skipping 28 matching lines...) Expand all
54 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
55 views::ImageView* icon = new ash::FixedSizedImageView( 56 views::ImageView* icon = new ash::FixedSizedImageView(
56 0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); 57 0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT));
57 58
58 icon->SetImage( 59 icon->SetImage(
59 rb.GetImageNamed(IDR_AURA_UBER_TRAY_SETTINGS).ToImageSkia()); 60 rb.GetImageNamed(IDR_AURA_UBER_TRAY_SETTINGS).ToImageSkia());
60 icon->set_id(test::kSettingsTrayItemViewId); 61 icon->set_id(test::kSettingsTrayItemViewId);
61 AddChildView(icon); 62 AddChildView(icon);
62 63
63 base::string16 text = rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_SETTINGS); 64 base::string16 text = rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_SETTINGS);
64 label_ = new views::Label(text); 65 label_ = TrayPopupUtils::CreateDefaultLabel();
66 label_->SetText(text);
65 AddChildView(label_); 67 AddChildView(label_);
66 SetAccessibleName(text); 68 SetAccessibleName(text);
67 69
68 power_view_right_align = true; 70 power_view_right_align = true;
69 } 71 }
70 72
71 if (PowerStatus::Get()->IsBatteryPresent()) { 73 if (PowerStatus::Get()->IsBatteryPresent()) {
72 power_status_view_ = new ash::PowerStatusView(power_view_right_align); 74 power_status_view_ = new ash::PowerStatusView(power_view_right_align);
73 AddChildView(power_status_view_); 75 AddChildView(power_status_view_);
74 OnPowerStatusChanged(); 76 OnPowerStatusChanged();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 168
167 void TraySettings::DestroyDefaultView() { 169 void TraySettings::DestroyDefaultView() {
168 default_view_ = nullptr; 170 default_view_ = nullptr;
169 } 171 }
170 172
171 void TraySettings::DestroyDetailedView() {} 173 void TraySettings::DestroyDetailedView() {}
172 174
173 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {} 175 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {}
174 176
175 } // namespace ash 177 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/chromeos/tray_caps_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698