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

Unified Diff: components/browsing_data/core/browsing_data_utils.cc

Issue 2730703003: Change CBD layout and texts (Closed)
Patch Set: try fix tests Created 3 years, 9 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: components/browsing_data/core/browsing_data_utils.cc
diff --git a/components/browsing_data/core/browsing_data_utils.cc b/components/browsing_data/core/browsing_data_utils.cc
index d353f009cfed075ca9361a78be9c48d8c6d8f43d..95d7ead5c820e372cc5eeb31165c00aa0e9d5ec8 100644
--- a/components/browsing_data/core/browsing_data_utils.cc
+++ b/components/browsing_data/core/browsing_data_utils.cc
@@ -66,7 +66,8 @@ void RecordDeletionForPeriod(TimePeriod period) {
}
base::string16 GetCounterTextFromResult(
- const browsing_data::BrowsingDataCounter::Result* result) {
+ const browsing_data::BrowsingDataCounter::Result* result,
+ ClearBrowsingDataTab cbd_tab) {
base::string16 text;
std::string pref_name = result->source()->GetPrefName();
@@ -96,11 +97,20 @@ base::string16 GetCounterTextFromResult(
history_result->Value();
bool has_synced_visits = history_result->has_synced_visits();
- text = has_synced_visits
- ? l10n_util::GetPluralStringFUTF16(
- IDS_DEL_BROWSING_HISTORY_COUNTER_SYNCED, local_item_count)
- : l10n_util::GetPluralStringFUTF16(
- IDS_DEL_BROWSING_HISTORY_COUNTER, local_item_count);
+ switch (cbd_tab) {
+ case ClearBrowsingDataTab::ADVANCED:
+ text =
+ has_synced_visits
+ ? l10n_util::GetPluralStringFUTF16(
+ IDS_DEL_BROWSING_HISTORY_COUNTER_SYNCED, local_item_count)
+ : l10n_util::GetPluralStringFUTF16(
+ IDS_DEL_BROWSING_HISTORY_COUNTER, local_item_count);
+ break;
+ // The basic tab doesn't show history counter results.
+ case ClearBrowsingDataTab::BASIC:
+ case browsing_data::ClearBrowsingDataTab::NUM_TYPES:
msramek 2017/03/15 10:23:35 nit: No need for the namespace.
+ NOTREACHED();
+ }
} else if (pref_name == browsing_data::prefs::kDeleteFormData) {
// Autofill counter.

Powered by Google App Engine
This is Rietveld 408576698