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

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

Issue 319193002: Update the malware interstitial to have the new layout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pre-review style fixes Created 6 years, 6 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/ssl/interstitial_v2.js
diff --git a/chrome/browser/resources/ssl/interstitial_v2.js b/chrome/browser/resources/ssl/interstitial_v2.js
index 99344ee8817551c61b2c651d2e8a2f1bef0a05a5..7050e31c028e263c71fc08b64b48319ac3ffe525 100644
--- a/chrome/browser/resources/ssl/interstitial_v2.js
+++ b/chrome/browser/resources/ssl/interstitial_v2.js
@@ -2,29 +2,41 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// This is the shared code for the new (Chrome 37) security interstitials. It is
+// used for both SSL interstitials and Safe Browsing interstitials.
+
var expandedDetails = false;
function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
+ var ssl = loadTimeData.getBoolean('ssl');
+
+ if (ssl)
+ applySSLStyle();
+ else
+ applyMalwareStyle();
$('primary-button').addEventListener('click', function() {
- if (overridable)
- sendCommand(CMD_DONT_PROCEED);
- else
+ if (!overridable && ssl)
sendCommand(CMD_RELOAD);
+ else
+ sendCommand(ssl ? CMD_DONT_PROCEED : SB_CMD_GO_BACK);
Bernhard Bauer 2014/06/09 10:04:03 I think you could reorder this as if (!ssl)
felt 2014/06/09 14:24:09 Done.
});
if (overridable) {
$('proceed-link').addEventListener('click', function(event) {
- sendCommand(CMD_PROCEED);
- event.preventDefault();
+ sendCommand(ssl ? CMD_PROCEED : SB_CMD_PROCEED);
});
}
- if (!overridable) {
+ if (!(ssl && overridable)) { // Overridable SSL page doesn't have this link.
$('help-link').addEventListener('click', function(event) {
- sendCommand(CMD_HELP);
- event.preventDefault();
+ if (ssl)
+ sendCommand(CMD_HELP);
+ else if (loadTimeData.getBoolean('phishing'))
+ sendCommand(SB_CMD_REPORT_ERROR);
+ else
+ sendCOmmand(SB_CMD_SHOW_DIAGNOSTIC);
});
}
@@ -35,11 +47,12 @@ function setupEvents() {
loadTimeData.getString('closeDetails');
if (!expandedDetails) {
// Record a histogram entry only the first time that details is opened.
- sendCommand(CMD_MORE);
+ sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_MORE);
expandedDetails = true;
}
- event.preventDefault();
});
+
+ preventDefaultOnPoundLinkClicks();
}
document.addEventListener('DOMContentLoaded', setupEvents);

Powered by Google App Engine
This is Rietveld 408576698