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

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

Issue 380943002: Added battery level and time to the status tray's accessible name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no longer adding strings, time now says 'current time' Created 6 years, 5 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/system/chromeos/power/power_status.cc
diff --git a/ash/system/chromeos/power/power_status.cc b/ash/system/chromeos/power/power_status.cc
index 8940e9ecb472b8b021a9e7270530541ee6f47a0c..251da6800a747cd582909e3616c65cb633234156 100644
--- a/ash/system/chromeos/power/power_status.cc
+++ b/ash/system/chromeos/power/power_status.cc
@@ -277,6 +277,20 @@ base::string16 PowerStatus::GetAccessibleNameString() const {
battery_time_accessible;
}
+base::string16 PowerStatus::GetShortAccessibleNameString() const {
dmazzoni 2014/07/10 17:28:20 Can you call this function from GetAccessibleNameS
evy 2014/07/10 18:57:40 Done.
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ if (IsBatteryFull()) {
+ return rb.GetLocalizedString(
+ IDS_ASH_STATUS_TRAY_BATTERY_FULL_CHARGE_ACCESSIBLE);
+ }
+
+ return l10n_util::GetStringFUTF16(
+ IsBatteryCharging()
+ ? IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_CHARGING_ACCESSIBLE
+ : IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_ACCESSIBLE,
+ base::IntToString16(GetRoundedBatteryPercent()));
+}
+
PowerStatus::PowerStatus() {
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698