Properly construct 'less than X MB' sentences for CBD

Currently "less than X MB" and "less than 1 MB" are inserted into "Frees
up $1" this might not work correctly when being translated so this CL
adds three separate sentences with only a placeholder for "X MB".

BUG=725401

Review-Url: https://codereview.chromium.org/2935443003
Cr-Commit-Position: refs/heads/master@{#478581}
diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils.cc b/chrome/browser/browsing_data/browsing_data_counter_utils.cc
index a165aae..589988a 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 @@
     // 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.
diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc
index d941e8f..1e0f88a 100644
--- a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc
@@ -55,9 +55,8 @@
       {2.312 * kBytesInAMegabyte, false, true,
        "Frees up 2.3 MB. Some sites may load more slowly on your next visit."},
       {2.312 * kBytesInAMegabyte, true, false, "Less than 2.3 MB"},
-      // TODO(725401): Fix upper case L in estimate string for desktop.
       {2.312 * kBytesInAMegabyte, true, true,
-       "Frees up Less than 2.3 MB. Some sites may load more slowly on your "
+       "Frees up less than 2.3 MB. Some sites may load more slowly on your "
        "next visit."},
       {500.2 * kBytesInAMegabyte, false, false, "500 MB"},
       {500.2 * kBytesInAMegabyte, true, false, "Less than 500 MB"},
diff --git a/components/browsing_data_strings.grdp b/components/browsing_data_strings.grdp
index 2f5317c..ec6eeeb6 100644
--- a/components/browsing_data_strings.grdp
+++ b/components/browsing_data_strings.grdp
@@ -22,12 +22,15 @@
   <message name="IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY" desc="A counter showing that the user's cache is almost empty, having less than 1 MB of data.">
     Less than 1 MB
   </message>
-  <message name="IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY_BASIC" desc="Text showing that the user has less than 1 MB of data. It will be included in the sentence 'Frees up $1.'">
-    less than 1 MB
-  </message>
-  <message name="IDS_DEL_CACHE_COUNTER_BASIC" desc="A counter showing the size of the users's cache including either 'x MB' or 'less than x MB' as $1 and explaining that the cache is used to speed up the loading of websites.">
+  <message name="IDS_DEL_CACHE_COUNTER_BASIC" desc="A counter showing the size of the users's cache. The estimate (e.g. '328 MB' will be substituted). It also explains that the cache is used to speed up the loading of websites.">
     Frees up <ph name="SIZE">$1<ex>328 MB</ex></ph>. Some sites may load more slowly on your next visit.
   </message>
+  <message name="IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE_BASIC" desc="A counter showing an upper estimate of the size of the users's cache. The estimate (e.g. '328 MB' will be substituted). It also explains that the cache is used to speed up the loading of websites.">
+    Frees up less than <ph name="SIZE">$1<ex>328 MB</ex></ph>. Some sites may load more slowly on your next visit.
+  </message>
+  <message name="IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY_BASIC" desc="A counter showing that the user's cache is almost empty and explaining that the cache is used to speed up the loading of websites.">
+    Frees up less than 1 MB. Some sites may load more slowly on your next visit.
+  </message>
   <message name="IDS_DEL_PASSWORDS_COUNTER" desc="A counter showing how many passwords the user has.">
     {COUNT, plural,
      =0 {None}