Commit 72ff3ce6 authored by Joe DeBlasio's avatar Joe DeBlasio Committed by Commit Bot

[Safety Tips] Update strings for Lookalike Safety Tip.

This CL updates the strings to reflect our latest iteration with UX.

Bug: 1114359
Change-Id: Ica65640967f7323286f65cd5f31f1ba491b49f14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343661Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Joe DeBlasio <jdeblasio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796196}
parent 4a8838b1
......@@ -101,5 +101,5 @@ void SafetyTipInfoBarDelegate::InfoBarDismissed() {
}
base::string16 SafetyTipInfoBarDelegate::GetDescriptionText() const {
return GetSafetyTipDescription(safety_tip_status_, url_, suggested_url_);
return GetSafetyTipDescription(safety_tip_status_, suggested_url_);
}
......@@ -93,7 +93,10 @@ base::string16 GetSafetyTipTitle(
IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_TITLE);
case security_state::SafetyTipStatus::kLookalike:
#if defined(OS_ANDROID)
return l10n_util::GetStringUTF16(IDS_SAFETY_TIP_ANDROID_LOOKALIKE_TITLE);
return l10n_util::GetStringFUTF16(
IDS_SAFETY_TIP_ANDROID_LOOKALIKE_TITLE,
security_interstitials::common_string_util::GetFormattedHostName(
suggested_url));
#else
return l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SAFETY_TIP_LOOKALIKE_TITLE,
......@@ -114,7 +117,6 @@ base::string16 GetSafetyTipTitle(
base::string16 GetSafetyTipDescription(
security_state::SafetyTipStatus warning_type,
const GURL& url,
const GURL& suggested_url) {
switch (warning_type) {
case security_state::SafetyTipStatus::kBadReputation:
......@@ -124,7 +126,6 @@ base::string16 GetSafetyTipDescription(
#if defined(OS_ANDROID)
return l10n_util::GetStringFUTF16(
IDS_SAFETY_TIP_ANDROID_LOOKALIKE_DESCRIPTION,
security_interstitials::common_string_util::GetFormattedHostName(url),
security_interstitials::common_string_util::GetFormattedHostName(
suggested_url));
#else
......@@ -148,12 +149,14 @@ int GetSafetyTipLeaveButtonId(security_state::SafetyTipStatus warning_type) {
switch (warning_type) {
#if defined(OS_ANDROID)
case security_state::SafetyTipStatus::kBadReputation:
return IDS_SAFETY_TIP_ANDROID_BAD_REPUTATION_LEAVE_BUTTON;
case security_state::SafetyTipStatus::kLookalike:
return IDS_SAFETY_TIP_ANDROID_LEAVE_BUTTON;
return IDS_SAFETY_TIP_ANDROID_LOOKALIKE_LEAVE_BUTTON;
#else
case security_state::SafetyTipStatus::kBadReputation:
return IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_LEAVE_BUTTON;
case security_state::SafetyTipStatus::kLookalike:
return IDS_PAGE_INFO_SAFETY_TIP_LEAVE_BUTTON;
return IDS_PAGE_INFO_SAFETY_TIP_LOOKALIKE_LEAVE_BUTTON;
#endif
case security_state::SafetyTipStatus::kBadReputationIgnored:
case security_state::SafetyTipStatus::kLookalikeIgnored:
......
......@@ -31,13 +31,11 @@ void OpenHelpCenterFromSafetyTip(content::WebContents* web_contents);
// Get the titles, descriptions, and button strings or IDs needed to describe
// the applicable warning type. Handles both Android and desktop warnings.
// |url| is the URL of the current page. |suggested_url| is the suggested URL to
// navigate to. Both URLs are used in formatting some strings.
// |suggested_url| is the suggested URL to navigate to, used in some strings.
base::string16 GetSafetyTipTitle(security_state::SafetyTipStatus warning_type,
const GURL& suggested_url);
base::string16 GetSafetyTipDescription(
security_state::SafetyTipStatus warning_type,
const GURL& url,
const GURL& suggested_url);
int GetSafetyTipLeaveButtonId(security_state::SafetyTipStatus warning_type);
......
......@@ -143,7 +143,7 @@ SafetyTipPageInfoBubbleView::SafetyTipPageInfoBubbleView(
bottom_layout->StartRowWithPadding(views::GridLayout::kFixedSize, kColumnId,
views::GridLayout::kFixedSize, spacing);
auto text_label = std::make_unique<views::Label>(
GetSafetyTipDescription(safety_tip_status, url_, suggested_url_));
GetSafetyTipDescription(safety_tip_status, suggested_url_));
text_label->SetMultiLine(true);
text_label->SetLineHeight(20);
text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
......
......@@ -45,17 +45,20 @@
<message name="IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_DESCRIPTION" desc="Body of message to display in the page info bubble when you are viewing a page that triggered a safety tip.">
This site could be fake or fraudulent. Chrome recommends leaving now.
</message>
<message name="IDS_PAGE_INFO_SAFETY_TIP_BAD_REPUTATION_LEAVE_BUTTON" desc="Text of button to leave a suspicious page. Shown on the safety tip page info bubble.">
Leave site
</message>
<message name="IDS_PAGE_INFO_SAFETY_TIP_MORE_INFO_LINK" desc="Text of link to Help Center page on safety tip page info bubble.">
Learn more
</message>
<message name="IDS_PAGE_INFO_SAFETY_TIP_LEAVE_BUTTON" desc="Text of button to leave a suspicious page shown on the safety tip page info bubble.">
Leave site
<message name="IDS_PAGE_INFO_SAFETY_TIP_LOOKALIKE_LEAVE_BUTTON" desc="Text of button to leave a lookalike site. Shown on the safety tip page info bubble. Answers the question 'Did you mean example.com?'.">
Yes, continue
</message>
<message name="IDS_PAGE_INFO_SAFETY_TIP_LOOKALIKE_TITLE" desc="Title of Safety Tip infobar on a domain that looks like another domain.">
Did you mean <ph name='LOOKALIKE_DOMAIN'>$1<ex>google.com</ex></ph>?
</message>
<message name="IDS_PAGE_INFO_SAFETY_TIP_LOOKALIKE_DESCRIPTION" desc="Body of a warning when the user visits a page that triggered a Safety Tip because the domain looked like another domain.">
This site's name looks similar to <ph name='LOOKALIKE_DOMAIN'>$1<ex>google.com</ex></ph>. Attackers sometimes mimic sites by making hard-to-see changes to the web address.
Attackers sometimes mimic sites by making hard-to-see changes to the web address.
</message>
<!-- Viewing file strings -->
......
7c31bdad65442b5fc6f7ccd1283ab6d54bd5bdd7
\ No newline at end of file
df14c960857c08e55816d0cd50445988f337be8a
\ No newline at end of file
7fa92a3f404032c58abeef97e056029d3db060d7
\ No newline at end of file
44f038a5ba5a51d6dd0b8066cd396b41539634c6
\ No newline at end of file
44f038a5ba5a51d6dd0b8066cd396b41539634c6
\ No newline at end of file
......@@ -462,14 +462,17 @@
</message>
<!-- Safety Tip summary strings for Android (Desktop is in page_info_strings.grdp) -->
<message name="IDS_SAFETY_TIP_ANDROID_LEAVE_BUTTON" desc="Text of button to ignore the warning on a suspicious page. Shown on the safety tip infobar.">
<message name="IDS_SAFETY_TIP_ANDROID_BAD_REPUTATION_LEAVE_BUTTON" desc="Text of button to ignore the warning on a suspicious page. Shown on the safety tip infobar.">
Leave site
</message>
<message name="IDS_SAFETY_TIP_ANDROID_LOOKALIKE_LEAVE_BUTTON" desc="Text of button to leave a suspicious page. Shown on the safety tip infobar. Answers the question 'Did you mean example.com?'.">
Yes, continue
</message>
<message name="IDS_SAFETY_TIP_ANDROID_LOOKALIKE_TITLE" desc="Title of Safety Tip infobar on a domain that looks like another domain.">
Is this the right site?
Did you mean <ph name='SUGGESTED_DOMAIN'>$1<ex>google.com</ex></ph>?
</message>
<message name="IDS_SAFETY_TIP_ANDROID_LOOKALIKE_DESCRIPTION" desc="Body of an infobar warning when the user visits a page that triggered a Safety Tip because the domain looked like another domain.">
<ph name='LOOKALIKE_DOMAIN'>$1<ex>fake-google.com</ex></ph> looks similar to <ph name='SUGGESTED_DOMAIN'>$2<ex>google.com</ex></ph>. Attackers sometimes mimic sites by using similar URLs.
Attackers sometimes mimic sites by making hard-to-see-changes to the web address.
</message>
<if expr="not is_ios">
......
d78ee69ac678f6b20a323feb48b48a38bfe2d848
\ No newline at end of file
d9d8988edc784098168f57a209bfd5b1b46f57b8
\ No newline at end of file
4453a422a7c4f017b650fcc89af959b0385feab5
\ No newline at end of file
c25e67e85068abb61bdb2e4e17f836429c4b9a04
\ No newline at end of file
4453a422a7c4f017b650fcc89af959b0385feab5
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment