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

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

Issue 600153004: Refactor SafeBrowsing and SSL interstitials to have a type variable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/resources/security_warnings/safe_browsing.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1905c5835661e7271f77c21cfea98494f4389740..ab376c277ee056b22268d083dafd98bd7fd43f35 100644
--- a/chrome/browser/resources/security_warnings/interstitial_v2.js
+++ b/chrome/browser/resources/security_warnings/interstitial_v2.js
@@ -26,7 +26,7 @@ function handleKeypress(e) {
if (BYPASS_SEQUENCE.charCodeAt(keyPressState) == e.keyCode) {
keyPressState++;
if (keyPressState == BYPASS_SEQUENCE.length) {
- sendCommand(CMD_PROCEED);
+ sendCommand(SSL_CMD_PROCEED);
keyPressState = 0;
}
} else {
@@ -65,7 +65,7 @@ function toggleDebuggingInfo() {
function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
- var ssl = loadTimeData.getBoolean('ssl');
+ var ssl = loadTimeData.getString('type') === 'SSL';
if (ssl) {
$('body').classList.add('ssl');
@@ -79,14 +79,14 @@ function setupEvents() {
if (!ssl)
sendCommand(SB_CMD_TAKE_ME_BACK);
else if (overridable)
- sendCommand(CMD_DONT_PROCEED);
+ sendCommand(SSL_CMD_DONT_PROCEED);
else
- sendCommand(CMD_RELOAD);
+ sendCommand(SSL_CMD_RELOAD);
});
if (overridable) {
$('proceed-link').addEventListener('click', function(event) {
- sendCommand(ssl ? CMD_PROCEED : SB_CMD_PROCEED);
+ sendCommand(ssl ? SSL_CMD_PROCEED : SB_CMD_PROCEED);
});
} else if (!ssl) {
$('final-paragraph').classList.add('hidden');
@@ -98,7 +98,7 @@ function setupEvents() {
// Overridable SSL page doesn't have this link.
$('help-link').addEventListener('click', function(event) {
if (ssl)
- sendCommand(CMD_HELP);
+ sendCommand(SSL_CMD_HELP);
else if (loadTimeData.getBoolean('phishing'))
sendCommand(SB_CMD_LEARN_MORE_2);
else
@@ -108,7 +108,7 @@ function setupEvents() {
if (ssl && $('clock-link')) {
$('clock-link').addEventListener('click', function(event) {
- sendCommand(CMD_CLOCK);
+ sendCommand(SSL_CMD_CLOCK);
});
}
@@ -119,7 +119,7 @@ function setupEvents() {
loadTimeData.getString('closeDetails');
if (!expandedDetails) {
// Record a histogram entry only the first time that details is opened.
- sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE);
+ sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE);
expandedDetails = true;
}
});
« no previous file with comments | « no previous file | chrome/browser/resources/security_warnings/safe_browsing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698