summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:03:18 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:03:18 +0000
commit410470630604453290d9e7d8f97b391bef5d46f9 (patch)
tree46ad8ed053514558b5b1ab1d0ce4ed037f0001fd /ash
parent36e78a82368a4b0b6d02cc0707bfcfaa888346de (diff)
downloadchromium_src-410470630604453290d9e7d8f97b391bef5d46f9.zip
chromium_src-410470630604453290d9e7d8f97b391bef5d46f9.tar.gz
chromium_src-410470630604453290d9e7d8f97b391bef5d46f9.tar.bz2
Revert 204085 "cros: Update charging not reliable battery status"
> cros: Update charging not reliable battery status > > Don't display the "charging not reliable" battery status in the > non-charging-non-discharging state, as that can happen normally in > some circumstances. Also, update the string to be more human-friendly. > See bug for details. > > BUG=246336 > TEST=manual, see bug > R=derat@chromium.org > > Review URL: https://codereview.chromium.org/15993020 TBR=jamescook@chromium.org Review URL: https://codereview.chromium.org/16012010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/chromeos/power/power_status_view.cc19
-rw-r--r--ash/system/chromeos/power/tray_power.cc11
2 files changed, 13 insertions, 17 deletions
diff --git a/ash/system/chromeos/power/power_status_view.cc b/ash/system/chromeos/power/power_status_view.cc
index d427875..9aa461c 100644
--- a/ash/system/chromeos/power/power_status_view.cc
+++ b/ash/system/chromeos/power/power_status_view.cc
@@ -32,13 +32,6 @@ 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,
@@ -130,8 +123,9 @@ 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 ?
- GetChargingUnreliableString() :
+ battery_time_status =
+ is_charging_unreliable ?
+ rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE) :
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_CALCULATING);
} else {
battery_percentage = l10n_util::GetStringFUTF16(
@@ -139,7 +133,8 @@ void PowerStatusView::UpdateTextForDefaultView() {
base::IntToString16(TrayPower::GetRoundedBatteryPercentage(
supply_status_.battery_percentage)));
if (is_charging_unreliable) {
- battery_time_status = GetChargingUnreliableString();
+ battery_time_status = rb.GetLocalizedString(
+ IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE);
} else {
if (supply_status_.is_calculating_battery_time) {
battery_time_status =
@@ -212,7 +207,9 @@ void PowerStatusView::UpdateTextForNotificationView() {
}
if (is_charging_unreliable) {
- time_label_->SetText(GetChargingUnreliableString());
+ time_label_->SetText(
+ ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
+ IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE));
} else if (supply_status_.is_calculating_battery_time) {
time_label_->SetText(
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
diff --git a/ash/system/chromeos/power/tray_power.cc b/ash/system/chromeos/power/tray_power.cc
index 7206fbe..64f33f2 100644
--- a/ash/system/chromeos/power/tray_power.cc
+++ b/ash/system/chromeos/power/tray_power.cc
@@ -217,12 +217,11 @@ TrayPower::~TrayPower() {
// static
bool TrayPower::IsBatteryChargingUnreliable(
const chromeos::PowerSupplyStatus& supply_status) {
- // Sometimes devices can get into a state where the battery is almost fully
- // charged and the power subsystem reports "neither charging nor discharging"
- // despite the battery not at 100%. For now, only report unreliable charging
- // on USB.
- // TODO(derat): Update this when the power manager code is refactored for M29.
- return supply_status.battery_state == PowerSupplyStatus::CONNECTED_TO_USB;
+ return
+ supply_status.battery_state ==
+ PowerSupplyStatus::NEITHER_CHARGING_NOR_DISCHARGING ||
+ supply_status.battery_state ==
+ PowerSupplyStatus::CONNECTED_TO_USB;
}
// static