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 c8a1ce52c417e36911b16c8d1e79baba026fa6e3..921c9527f57b95c915fc2860161029b276dcac2d 100644 |
--- a/chrome/browser/resources/security_warnings/interstitial_v2.js |
+++ b/chrome/browser/resources/security_warnings/interstitial_v2.js |
@@ -25,6 +25,8 @@ var CMD_DONT_REPORT = 9; |
var CMD_OPEN_REPORTING_PRIVACY = 10; |
// Report a phishing error. |
var CMD_REPORT_PHISHING_ERROR = 11; |
+// Navigate to suggested URL. |
+var CMD_NAVIGATE_SUGGESTED_URL = 12; |
meacer
2015/07/28 01:18:05
nit: CMD_OPEN_SUGGESTED_URL instead, to be consist
Bhanu Dev
2015/07/30 02:39:09
Done.
|
/** |
* A convenience method for sending commands to the parent page. |
@@ -89,6 +91,8 @@ function setupEvents() { |
var badClock = ssl && loadTimeData.getBoolean('bad_clock'); |
var hidePrimaryButton = badClock && loadTimeData.getBoolean( |
'hide_primary_button'); |
+ var commonNameMismatchInterstitial = loadTimeData.getBoolean( |
meacer
2015/07/28 01:18:05
Could also check for |ssl| here:
var commonNameMi
Bhanu Dev
2015/07/30 02:39:09
Done.
|
+ 'common_name_mismatch_interstitial'); |
meacer
2015/07/28 01:18:05
nit: common_name_mismatch instead of common_name_m
Bhanu Dev
2015/07/30 02:39:09
Done.
|
if (ssl) { |
$('body').classList.add(badClock ? 'bad-clock' : 'ssl'); |
@@ -174,6 +178,14 @@ function setupEvents() { |
}); |
} |
+ if (commonNameMismatchInterstitial) { |
+ // Send a command if user clicks the suggested URL. |
+ $('suggest-link').addEventListener('click', function(event) { |
+ sendCommand(CMD_NAVIGATE_SUGGESTED_URL); |
+ }); |
+ } |
meacer
2015/07/28 01:18:05
Move this block above |if (captivePortal)| since i
Bhanu Dev
2015/07/30 02:39:09
Done.
|
+ |
+ |
meacer
2015/07/28 01:18:04
Remove extra line
Bhanu Dev
2015/07/30 02:39:09
Done.
|
// TODO(felt): This should be simplified once the Finch trial is no longer |
// needed. |
if (interstitialType == 'SAFEBROWSING' && |