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

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

Issue 15993020: REVERTED cros: Update charging not reliable battery status (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comment Created 7 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
« no previous file with comments | « no previous file | ash/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/power_status_view.cc
diff --git a/ash/system/chromeos/power/power_status_view.cc b/ash/system/chromeos/power/power_status_view.cc
index 9aa461c90cdcd80369056eb54cf5b3cf5708c78f..d4278755b4ba458a35ea0d267e8981bb0afe3361 100644
--- a/ash/system/chromeos/power/power_status_view.cc
+++ b/ash/system/chromeos/power/power_status_view.cc
@@ -32,6 +32,13 @@ const int kLabelMinWidth = 120;
const int kPaddingBetweenBatteryStatusAndIcon = 3;
// Minimum battery percentage rendered in UI.
const int kMinBatteryPercent = 1;
+
+base::string16 GetChargingUnreliableString() {
+ // String is intentionally hard-coded in English for backport to M28 only.
+ // See crbug.com/246336 for details.
+ return UTF8ToUTF16("Low-power charger");
+}
+
} // namespace
PowerStatusView::PowerStatusView(ViewType view_type,
@@ -123,9 +130,8 @@ void PowerStatusView::UpdateTextForDefaultView() {
battery_time_status =
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_FULL);
} else if (supply_status_.battery_percentage < 0.0f) {
- battery_time_status =
- is_charging_unreliable ?
- rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE) :
+ battery_time_status = is_charging_unreliable ?
+ GetChargingUnreliableString() :
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_CALCULATING);
} else {
battery_percentage = l10n_util::GetStringFUTF16(
@@ -133,8 +139,7 @@ void PowerStatusView::UpdateTextForDefaultView() {
base::IntToString16(TrayPower::GetRoundedBatteryPercentage(
supply_status_.battery_percentage)));
if (is_charging_unreliable) {
- battery_time_status = rb.GetLocalizedString(
- IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE);
+ battery_time_status = GetChargingUnreliableString();
} else {
if (supply_status_.is_calculating_battery_time) {
battery_time_status =
@@ -207,9 +212,7 @@ void PowerStatusView::UpdateTextForNotificationView() {
}
if (is_charging_unreliable) {
- time_label_->SetText(
- ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
- IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE));
+ time_label_->SetText(GetChargingUnreliableString());
} else if (supply_status_.is_calculating_battery_time) {
time_label_->SetText(
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
« no previous file with comments | « no previous file | ash/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698