Commit 5842d631 authored by lgarron's avatar lgarron Committed by Commit bot

Clock interstitial: refine iOS text and hide 'Advanced' button.

On iOS, we can't link directly to the date and time settings, so we hide the primary button and add an extra description to the main paragraph instructing them how to do so.
For all platforms, we completely hide the 'Advanced' button on the SSL clock interstitial. (It was replaced with 'Reload' in previous iterations.)

Hide Reload button for all clock errors.

BUG=414843

Review URL: https://codereview.chromium.org/693093003

Cr-Commit-Position: refs/heads/master@{#302664}
parent eec0e16f
......@@ -9709,9 +9709,24 @@ and incorrect credentials. Either an attacker is trying to pretend to be <ph nam
Update date and time
</message>
<message name="IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH" desc="Paragraph explaining that the SSL clock interstitial is probably caused by an incorrect clock.">
A private connection to <ph name="DOMAIN">$1<ex>paypal.com</ex></ph> can't be established because your computer's date and time (<ph name="DATE_AND_TIME">$2<ex>Monday, January 1, 1970 2:44:30 PM</ex></ph>) are incorrect.
</message>
<if expr="not is_android and not is_ios">
<message name="IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH" desc="Paragraph explaining that the SSL clock interstitial is probably caused by an incorrect clock.">
A private connection to <ph name="DOMAIN">$1<ex>paypal.com</ex></ph> can't be established because your computer's date and time (<ph name="DATE_AND_TIME">$2<ex>Monday, January 1, 1970 2:44:30 PM</ex></ph>) are incorrect.
</message>
</if>
<if expr="is_android">
<message name="IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH" desc="Paragraph explaining that the SSL clock interstitial is probably caused by an incorrect clock. (The string is slightly customized for mobile.)">
A private connection to <ph name="DOMAIN">$1<ex>paypal.com</ex></ph> can't be established because your device's date and time (<ph name="DATE_AND_TIME">$2<ex>Monday, January 1, 1970 2:44:30 PM</ex></ph>) are incorrect.
</message>
</if>
<if expr="is_ios">
<message name="IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH" desc="Paragraph explaining that the SSL clock interstitial is probably caused by an incorrect clock. On iOS, we can't send the user directly to the date and time panel, so we give them concise instructions.">
&lt;p&gt;A private connection to <ph name="DOMAIN">$1<ex>paypal.com</ex></ph> can't be established because your device's date and time (<ph name="DATE_AND_TIME">$2<ex>Monday, January 1, 1970 2:44:30 PM</ex></ph>) are incorrect.&lt;/p&gt;
&lt;p&gt;Please adjust the date and time from the &lt;strong&gt;General&lt;/strong&gt; section of the &lt;strong&gt;Settings&lt;/strong&gt; app.&lt;/p&gt;
</message>
</if>
<!-- Misc strings for SSL UI -->
<message name="IDS_UNSAFE_FRAME_MESSAGE" desc="The text displayed in the content that is subsituted to an unsafe frame.">
......
......@@ -67,6 +67,8 @@ function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
var ssl = loadTimeData.getString('type') === 'SSL';
var badClock = ssl && loadTimeData.getBoolean('bad_clock');
var hidePrimaryButton = badClock && loadTimeData.getBoolean(
'hide_primary_button');
if (ssl) {
$('body').classList.add(badClock ? 'bad-clock' : 'ssl');
......@@ -76,16 +78,20 @@ function setupEvents() {
$('body').classList.add('safe-browsing');
}
$('primary-button').addEventListener('click', function() {
if (!ssl)
sendCommand(SB_CMD_TAKE_ME_BACK);
else if (badClock)
sendCommand(SSL_CMD_CLOCK);
else if (overridable)
sendCommand(SSL_CMD_DONT_PROCEED);
else
sendCommand(SSL_CMD_RELOAD);
});
if (hidePrimaryButton) {
$('primary-button').classList.add('hidden');
} else {
$('primary-button').addEventListener('click', function() {
if (!ssl)
sendCommand(SB_CMD_TAKE_ME_BACK);
else if (badClock)
sendCommand(SSL_CMD_CLOCK);
else if (overridable)
sendCommand(SSL_CMD_DONT_PROCEED);
else
sendCommand(SSL_CMD_RELOAD);
});
}
if (overridable) {
$('proceed-link').addEventListener('click', function(event) {
......@@ -110,18 +116,14 @@ function setupEvents() {
}
$('details-button').addEventListener('click', function(event) {
if (badClock) {
sendCommand(SSL_CMD_RELOAD);
} else {
var hiddenDetails = $('details').classList.toggle('hidden');
$('details-button').innerText = hiddenDetails ?
loadTimeData.getString('openDetails') :
loadTimeData.getString('closeDetails');
if (!expandedDetails) {
// Record a histogram entry only the first time that details is opened.
sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE);
expandedDetails = true;
}
var hiddenDetails = $('details').classList.toggle('hidden');
$('details-button').innerText = hiddenDetails ?
loadTimeData.getString('openDetails') :
loadTimeData.getString('closeDetails');
if (!expandedDetails) {
// Record a histogram entry only the first time that details is opened.
sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE);
expandedDetails = true;
}
});
......
......@@ -233,7 +233,7 @@ void LaunchDateAndTimeSettings() {
"'com.android.settings/.Settings$DateTimeSettingsActivity'");
#elif defined(OS_IOS)
// iOS does not have a way to launch the date and time settings.
return;
NOTREACHED();
#elif defined(OS_LINUX)
struct ClockCommand {
const char* pathname;
......@@ -432,6 +432,12 @@ std::string SSLBlockingPage::GetHTMLContents() {
load_time_data.SetBoolean("bad_clock", true);
load_time_data.SetBoolean("overridable", false);
#if defined(OS_IOS)
load_time_data.SetBoolean("hide_primary_button", true);
#else
load_time_data.SetBoolean("hide_primary_button", false);
#endif
// We're showing the SSL clock warning to be helpful, but we haven't warned
// them about the risks. (And there might still be an SSL error after they
// fix their clock.) Thus, we don't allow the "danger" override in this
......@@ -457,9 +463,9 @@ std::string SSLBlockingPage::GetHTMLContents() {
load_time_data.SetString(
"primaryButtonText",
l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME));
load_time_data.SetString(
"openDetails",
l10n_util::GetStringUTF16(IDS_SSL_RELOAD));
// We set the "Advanced" link to be empty so that it doesn't appear.
load_time_data.SetString("openDetails", std::string());
// The interstitial template expects these strings, but we're not using
// them. So we send blank strings for now.
......
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