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

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: Rebased again 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 50ae66bb1aa363731b304ffd2094985370ac9dde..c250196b48d6ef379d7692b15121cd67c1ede6e0 100644
--- a/chrome/browser/resources/ssl/interstitial_v2.js
+++ b/chrome/browser/resources/ssl/interstitial_v2.js
@@ -2,13 +2,24 @@
// 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
+ applySafeBrowsingStyle();
$('primary-button').addEventListener('click', function() {
- if (overridable)
+ if (!ssl)
+ sendCommand(SB_CMD_TAKE_ME_BACK);
+ else if (overridable)
sendCommand(CMD_DONT_PROCEED);
else
sendCommand(CMD_RELOAD);
@@ -16,13 +27,18 @@ function setupEvents() {
if (overridable) {
$('proceed-link').addEventListener('click', function(event) {
- sendCommand(CMD_PROCEED);
- event.preventDefault();
+ sendCommand(ssl ? CMD_PROCEED : SB_CMD_PROCEED);
});
- } else {
+ }
+
+ 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);
});
$('error-code').textContent = loadTimeData.getString('errorCode');
@@ -36,11 +52,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_SEE_MORE);
expandedDetails = true;
}
- event.preventDefault();
});
+
+ preventDefaultOnPoundLinkClicks();
}
document.addEventListener('DOMContentLoaded', setupEvents);
« no previous file with comments | « chrome/browser/resources/ssl/interstitial_v2.html ('k') | chrome/browser/resources/ssl/ssl_errors_common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698