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

Unified Diff: chrome/browser/ui/webui/options/website_settings_handler.cc

Issue 586563002: Display "<1%" instead of 0% on the battery usage display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Escape the character. Created 6 years, 3 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 | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/website_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/website_settings_handler.cc b/chrome/browser/ui/webui/options/website_settings_handler.cc
index f946b120764f91361dbd1e9572716f935c39b766..587616412cdd4573f910b3f2eadb7556199158b2 100644
--- a/chrome/browser/ui/webui/options/website_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/website_settings_handler.cc
@@ -683,10 +683,16 @@ void WebsiteSettingsHandler::UpdateBatteryUsage() {
base::DictionaryValue* origin_entry = new base::DictionaryValue();
origin_entry->SetInteger("usage", it->second);
- origin_entry->SetString(
- "usageString",
- l10n_util::GetStringFUTF16Int(IDS_WEBSITE_SETTINGS_BATTERY_PERCENT,
- it->second));
+ if (it->second == 0) {
+ origin_entry->SetString(
+ "usageString",
+ l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_BATTERY_ZERO_PERCENT));
+ } else {
+ origin_entry->SetString(
+ "usageString",
+ l10n_util::GetStringFUTF16Int(IDS_WEBSITE_SETTINGS_BATTERY_PERCENT,
+ it->second));
+ }
origin_entry->SetStringWithoutPathExpansion("readableName",
GetReadableName(it->first));
power_map.SetWithoutPathExpansion(origin, origin_entry);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698