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

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: 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
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 0da23b75ebbc62df85ffb1c03238e5d2cadaaa67..feaff1472b6c860bc5b0aeb0095f2cdb6f974052 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 {
@@ -36,7 +36,7 @@ function handleKeypress(e) {
function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
- var ssl = loadTimeData.getBoolean('ssl');
+ var ssl = loadTimeData.getString('type') === 'ssl';
if (ssl) {
$('body').classList.add('ssl');
@@ -50,14 +50,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');
@@ -69,7 +69,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
@@ -79,7 +79,7 @@ function setupEvents() {
if (ssl && $('clock-link')) {
$('clock-link').addEventListener('click', function(event) {
- sendCommand(CMD_CLOCK);
+ sendCommand(SSL_CMD_CLOCK);
});
}
@@ -90,7 +90,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;
}
});

Powered by Google App Engine
This is Rietveld 408576698