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

Unified Diff: chrome/browser/browsing_data/browsing_data_counter_utils.cc

Issue 2935443003: Properly construct 'less than' sentences (Closed)
Patch Set: fix string description Created 3 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 | chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_counter_utils.cc
diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils.cc b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
index a165aaebf110024fa70fc4faf15e47d86ea85a58..589988a7ddef6516b01adbf939d47735f7d80d93 100644
--- a/chrome/browser/browsing_data/browsing_data_counter_utils.cc
+++ b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
@@ -81,24 +81,21 @@ base::string16 GetChromeCounterTextFromResult(
// Three cases: Nonzero result for the entire cache, nonzero result for
// a subset of cache (i.e. a finite time interval), and almost zero (< 1MB).
static const int kBytesInAMegabyte = 1024 * 1024;
- base::string16 size_string;
if (cache_size_bytes >= kBytesInAMegabyte) {
base::string16 formatted_size = FormatBytesMBOrHigher(cache_size_bytes);
- size_string = !is_upper_limit ? formatted_size
- : l10n_util::GetStringFUTF16(
- IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE,
- formatted_size);
- } else {
- size_string = l10n_util::GetStringUTF16(
- is_basic_tab ? IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY_BASIC
- : IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY);
+ if (!is_upper_limit) {
+ return is_basic_tab ? l10n_util::GetStringFUTF16(
+ IDS_DEL_CACHE_COUNTER_BASIC, formatted_size)
+ : formatted_size;
+ }
+ return l10n_util::GetStringFUTF16(
+ is_basic_tab ? IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE_BASIC
+ : IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE,
+ formatted_size);
}
- if (is_basic_tab) {
- // Wrap the size string inside a sentence.
- return l10n_util::GetStringFUTF16(IDS_DEL_CACHE_COUNTER_BASIC,
- size_string);
- }
- return size_string;
+ return l10n_util::GetStringUTF16(
+ is_basic_tab ? IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY_BASIC
+ : IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY);
}
if (pref_name == browsing_data::prefs::kDeleteCookiesBasic) {
// The basic tab doesn't show cookie counter results.
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698