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 ...@@ -9709,9 +9709,24 @@ and incorrect credentials. Either an attacker is trying to pretend to be <ph nam
Update date and time Update date and time
</message> </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. <if expr="not is_android and not is_ios">
</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>
<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 --> <!-- 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."> <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() { ...@@ -67,6 +67,8 @@ function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable'); var overridable = loadTimeData.getBoolean('overridable');
var ssl = loadTimeData.getString('type') === 'SSL'; var ssl = loadTimeData.getString('type') === 'SSL';
var badClock = ssl && loadTimeData.getBoolean('bad_clock'); var badClock = ssl && loadTimeData.getBoolean('bad_clock');
var hidePrimaryButton = badClock && loadTimeData.getBoolean(
'hide_primary_button');
if (ssl) { if (ssl) {
$('body').classList.add(badClock ? 'bad-clock' : 'ssl'); $('body').classList.add(badClock ? 'bad-clock' : 'ssl');
...@@ -76,16 +78,20 @@ function setupEvents() { ...@@ -76,16 +78,20 @@ function setupEvents() {
$('body').classList.add('safe-browsing'); $('body').classList.add('safe-browsing');
} }
$('primary-button').addEventListener('click', function() { if (hidePrimaryButton) {
if (!ssl) $('primary-button').classList.add('hidden');
sendCommand(SB_CMD_TAKE_ME_BACK); } else {
else if (badClock) $('primary-button').addEventListener('click', function() {
sendCommand(SSL_CMD_CLOCK); if (!ssl)
else if (overridable) sendCommand(SB_CMD_TAKE_ME_BACK);
sendCommand(SSL_CMD_DONT_PROCEED); else if (badClock)
else sendCommand(SSL_CMD_CLOCK);
sendCommand(SSL_CMD_RELOAD); else if (overridable)
}); sendCommand(SSL_CMD_DONT_PROCEED);
else
sendCommand(SSL_CMD_RELOAD);
});
}
if (overridable) { if (overridable) {
$('proceed-link').addEventListener('click', function(event) { $('proceed-link').addEventListener('click', function(event) {
...@@ -110,18 +116,14 @@ function setupEvents() { ...@@ -110,18 +116,14 @@ function setupEvents() {
} }
$('details-button').addEventListener('click', function(event) { $('details-button').addEventListener('click', function(event) {
if (badClock) { var hiddenDetails = $('details').classList.toggle('hidden');
sendCommand(SSL_CMD_RELOAD); $('details-button').innerText = hiddenDetails ?
} else { loadTimeData.getString('openDetails') :
var hiddenDetails = $('details').classList.toggle('hidden'); loadTimeData.getString('closeDetails');
$('details-button').innerText = hiddenDetails ? if (!expandedDetails) {
loadTimeData.getString('openDetails') : // Record a histogram entry only the first time that details is opened.
loadTimeData.getString('closeDetails'); sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE);
if (!expandedDetails) { expandedDetails = true;
// 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() { ...@@ -233,7 +233,7 @@ void LaunchDateAndTimeSettings() {
"'com.android.settings/.Settings$DateTimeSettingsActivity'"); "'com.android.settings/.Settings$DateTimeSettingsActivity'");
#elif defined(OS_IOS) #elif defined(OS_IOS)
// iOS does not have a way to launch the date and time settings. // iOS does not have a way to launch the date and time settings.
return; NOTREACHED();
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
struct ClockCommand { struct ClockCommand {
const char* pathname; const char* pathname;
...@@ -432,6 +432,12 @@ std::string SSLBlockingPage::GetHTMLContents() { ...@@ -432,6 +432,12 @@ std::string SSLBlockingPage::GetHTMLContents() {
load_time_data.SetBoolean("bad_clock", true); load_time_data.SetBoolean("bad_clock", true);
load_time_data.SetBoolean("overridable", false); 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 // 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 // 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 // fix their clock.) Thus, we don't allow the "danger" override in this
...@@ -457,9 +463,9 @@ std::string SSLBlockingPage::GetHTMLContents() { ...@@ -457,9 +463,9 @@ std::string SSLBlockingPage::GetHTMLContents() {
load_time_data.SetString( load_time_data.SetString(
"primaryButtonText", "primaryButtonText",
l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME)); l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME));
load_time_data.SetString(
"openDetails", // We set the "Advanced" link to be empty so that it doesn't appear.
l10n_util::GetStringUTF16(IDS_SSL_RELOAD)); load_time_data.SetString("openDetails", std::string());
// The interstitial template expects these strings, but we're not using // The interstitial template expects these strings, but we're not using
// them. So we send blank strings for now. // 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