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

Unified Diff: components/supervised_user_error_page/supervised_user_error_page.cc

Issue 2479413004: Supervised User interstitial: Update strings to be more child-friendly (Closed)
Patch Set: final? Created 4 years, 1 month 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/supervised_user_error_page/supervised_user_error_page.cc
diff --git a/components/supervised_user_error_page/supervised_user_error_page.cc b/components/supervised_user_error_page/supervised_user_error_page.cc
index 449c24ceca446191d88d11a1beb0e2c1092accbe..085581bc875d0f8e1ff7e49c61ad86b499fda175 100644
--- a/components/supervised_user_error_page/supervised_user_error_page.cc
+++ b/components/supervised_user_error_page/supervised_user_error_page.cc
@@ -37,22 +37,6 @@ std::string BuildAvatarImageUrl(const std::string& url, int size) {
return result;
}
-int GetBlockHeaderID(FilteringBehaviorReason reason) {
- switch (reason) {
- case DEFAULT:
- return IDS_SUPERVISED_USER_BLOCK_HEADER_DEFAULT;
- case BLACKLIST:
- case ASYNC_CHECKER:
- return IDS_SUPERVISED_USER_BLOCK_HEADER_SAFE_SITES;
- case WHITELIST:
- NOTREACHED();
- break;
- case MANUAL:
- return IDS_SUPERVISED_USER_BLOCK_HEADER_MANUAL;
- }
- NOTREACHED();
- return 0;
-}
} // namespace
int GetBlockMessageID(FilteringBehaviorReason reason,
@@ -110,27 +94,31 @@ std::string BuildHtml(bool allow_access_requests,
strings.SetString("secondCustodianName", base::UTF8ToUTF16(second_custodian));
strings.SetString("secondCustodianEmail",
base::UTF8ToUTF16(second_custodian_email));
+ base::string16 block_header;
base::string16 block_message;
if (allow_access_requests) {
if (is_child_account) {
- block_message = l10n_util::GetStringUTF16(
- second_custodian.empty()
- ? IDS_CHILD_BLOCK_INTERSTITIAL_MESSAGE_SINGLE_PARENT
- : IDS_CHILD_BLOCK_INTERSTITIAL_MESSAGE_MULTI_PARENT);
+ block_header =
+ l10n_util::GetStringUTF16(IDS_CHILD_BLOCK_INTERSTITIAL_HEADER);
+ block_message =
+ l10n_util::GetStringUTF16(IDS_CHILD_BLOCK_INTERSTITIAL_MESSAGE);
} else {
- block_message = l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_MESSAGE,
- custodian16);
+ block_header = l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_HEADER,
+ custodian16);
+ // For non-child accounts, the block message is empty.
}
} else {
- block_message = l10n_util::GetStringUTF16(
- IDS_BLOCK_INTERSTITIAL_MESSAGE_ACCESS_REQUESTS_DISABLED);
+ block_header = l10n_util::GetStringUTF16(
+ IDS_BLOCK_INTERSTITIAL_HEADER_ACCESS_REQUESTS_DISABLED);
+ // If access requests are disabled, there is no block message.
}
+ strings.SetString("blockPageHeader", block_header);
strings.SetString("blockPageMessage", block_message);
strings.SetString("blockReasonMessage",
l10n_util::GetStringUTF16(GetBlockMessageID(
reason, is_child_account, second_custodian.empty())));
- strings.SetString("blockReasonHeader",
- l10n_util::GetStringUTF16(GetBlockHeaderID(reason)));
+ strings.SetString("blockReasonHeader", l10n_util::GetStringUTF16(
+ IDS_SUPERVISED_USER_BLOCK_HEADER));
bool show_feedback = false;
#if defined(GOOGLE_CHROME_BUILD)
show_feedback = is_child_account && ReasonIsAutomatic(reason);

Powered by Google App Engine
This is Rietveld 408576698