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

Unified Diff: ash/common/system/chromeos/power/power_status_view.cc

Issue 2774093002: Change PowerStatus::GetBatteryImage to not use ExtractImageRep and scale (Closed)
Patch Set: powericon: removedeadunittestcode Created 3 years, 9 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/power/power_status_view.cc
diff --git a/ash/common/system/chromeos/power/power_status_view.cc b/ash/common/system/chromeos/power/power_status_view.cc
index 3e918b98496f4f9c1f728cc96a27d14a1732124a..e7d5b1d841d7bfae274f111b2639bb7bdf02da38 100644
--- a/ash/common/system/chromeos/power/power_status_view.cc
+++ b/ash/common/system/chromeos/power/power_status_view.cc
@@ -32,8 +32,7 @@ PowerStatusView::PowerStatusView(bool default_view_right_align)
: default_view_right_align_(default_view_right_align),
percentage_label_(new views::Label),
separator_label_(new views::Label),
- time_status_label_(new views::Label),
- icon_(nullptr) {
+ time_status_label_(new views::Label) {
if (MaterialDesignController::IsSystemTrayMenuMaterial())
SetFocusBehavior(FocusBehavior::ALWAYS);
@@ -51,20 +50,6 @@ PowerStatusView::~PowerStatusView() {
void PowerStatusView::OnPowerStatusChanged() {
UpdateText();
-
- // We do not show a battery icon in the material design system menu.
- // TODO(tdanderson): Remove the non-MD code and the IconSet enum once
- // material design is enabled by default. See crbug.com/614453.
- if (MaterialDesignController::UseMaterialDesignSystemIcons())
- return;
-
- const PowerStatus::BatteryImageInfo info =
- PowerStatus::Get()->GetBatteryImageInfo(PowerStatus::ICON_DARK);
- if (info != previous_battery_image_info_) {
- icon_->SetImage(PowerStatus::Get()->GetBatteryImage(info));
- icon_->SetVisible(true);
- previous_battery_image_info_ = info;
- }
}
void PowerStatusView::LayoutView() {
@@ -77,9 +62,7 @@ void PowerStatusView::LayoutView() {
AddChildView(percentage_label_);
AddChildView(separator_label_);
AddChildView(time_status_label_);
-
- icon_ = new views::ImageView;
- AddChildView(icon_);
+ AddChildView(new views::ImageView);
return;
}
@@ -92,10 +75,8 @@ void PowerStatusView::LayoutView() {
kTrayPopupPaddingBetweenItems);
SetLayoutManager(layout);
- if (!material_design) {
- icon_ = TrayPopupUtils::CreateMainImageView();
- AddChildView(icon_);
- }
+ if (!material_design)
+ AddChildView(TrayPopupUtils::CreateMainImageView());
AddChildView(percentage_label_);
AddChildView(separator_label_);
« no previous file with comments | « ash/common/system/chromeos/power/power_status_view.h ('k') | ash/common/system/chromeos/power/power_status_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698