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

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

Issue 2063633002: Render Ash material design battery image icon without PNGs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests added Created 4 years, 6 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 a30ce2c45022b41134f8ecad63c01a57de244230..a0725e10cb11278e2fb70117dbebd2c53e931e15 100644
--- a/ash/common/system/chromeos/power/power_status_view.cc
+++ b/ash/common/system/chromeos/power/power_status_view.cc
@@ -43,11 +43,17 @@ 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(PowerStatus::ICON_DARK));
+ icon_->SetImage(PowerStatus::Get()->GetBatteryImage(info));
icon_->SetVisible(true);
previous_battery_image_info_ = info;
}

Powered by Google App Engine
This is Rietveld 408576698