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

Unified Diff: chrome/browser/resources/security_warnings/interstitial_v2.js

Issue 664503006: Implementation of the full clock interstitial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: chrome/browser/resources/security_warnings/interstitial_v2.js
diff --git a/chrome/browser/resources/security_warnings/interstitial_v2.js b/chrome/browser/resources/security_warnings/interstitial_v2.js
index ab376c277ee056b22268d083dafd98bd7fd43f35..e71f39ff2c1b6b64503fcd81fbf1122e04ea3ae6 100644
--- a/chrome/browser/resources/security_warnings/interstitial_v2.js
+++ b/chrome/browser/resources/security_warnings/interstitial_v2.js
@@ -66,9 +66,12 @@ function toggleDebuggingInfo() {
function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
var ssl = loadTimeData.getString('type') === 'SSL';
+ var badClock = ssl && loadTimeData.getBoolean('bad_clock');
if (ssl) {
- $('body').classList.add('ssl');
+ var bodyClass = badClock ? 'bad-clock' : 'ssl';
felt 2014/10/23 01:54:10 you could simplify here: $('body').classList.dd(ba
lgarron 2014/10/23 03:02:04 Personally, I prefer not to use ternary operators
felt 2014/10/23 05:26:22 It seems odd to define a variable that's only used
lgarron 2014/10/23 19:37:44 Hmm, I don't really find it odd. In any case, I've
+ $('body').classList.add(bodyClass);
felt 2014/10/23 01:54:10 I'm surprised you don't need both ssl and bad-cloc
lgarron 2014/10/23 03:02:04 Yep, exactly. (I was surprised, too!) If we expec
+
$('error-code').textContent = loadTimeData.getString('errorCode');
$('error-code').classList.remove('hidden');
} else {
@@ -78,6 +81,8 @@ function setupEvents() {
$('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
@@ -106,21 +111,19 @@ function setupEvents() {
});
}
- if (ssl && $('clock-link')) {
- $('clock-link').addEventListener('click', function(event) {
- sendCommand(SSL_CMD_CLOCK);
- });
- }
-
$('details-button').addEventListener('click', function(event) {
- 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;
+ 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;
+ }
}
});

Powered by Google App Engine
This is Rietveld 408576698