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

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: removed old view before storing a new one 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
« no previous file with comments | « ash/system/chromeos/power/power_status.h ('k') | 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.cc
diff --git a/ash/system/chromeos/power/power_status.cc b/ash/system/chromeos/power/power_status.cc
index 8940e9ecb472b8b021a9e7270530541ee6f47a0c..591c31887b3eb0b45434ee3833907dbd038c625f 100644
--- a/ash/system/chromeos/power/power_status.cc
+++ b/ash/system/chromeos/power/power_status.cc
@@ -235,7 +235,8 @@ gfx::ImageSkia PowerStatus::GetBatteryImage(IconSet icon_set) const {
return gfx::ImageSkiaOperations::ExtractSubset(*all.ToImageSkia(), region);
}
-base::string16 PowerStatus::GetAccessibleNameString() const {
+base::string16 PowerStatus::GetAccessibleNameString(
+ bool full_description) const {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (IsBatteryFull()) {
return rb.GetLocalizedString(
@@ -247,6 +248,9 @@ base::string16 PowerStatus::GetAccessibleNameString() const {
IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_CHARGING_ACCESSIBLE :
IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_ACCESSIBLE,
base::IntToString16(GetRoundedBatteryPercent()));
+ if (!full_description)
+ return battery_percentage_accessible;
+
base::string16 battery_time_accessible = base::string16();
const base::TimeDelta time = IsBatteryCharging() ? GetBatteryTimeToFull() :
GetBatteryTimeToEmpty();
« no previous file with comments | « ash/system/chromeos/power/power_status.h ('k') | ash/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698