| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This is the shared code for the new (Chrome 37) security interstitials. It is | 5 // This is the shared code for the new (Chrome 37) security interstitials. It is |
| 6 // used for both SSL interstitials and Safe Browsing interstitials. | 6 // used for both SSL interstitials and Safe Browsing interstitials. |
| 7 | 7 |
| 8 var expandedDetails = false; | 8 var expandedDetails = false; |
| 9 | 9 |
| 10 function setupEvents() { | 10 function setupEvents() { |
| 11 var overridable = loadTimeData.getBoolean('overridable'); | 11 var overridable = loadTimeData.getBoolean('overridable'); |
| 12 var ssl = loadTimeData.getBoolean('ssl'); | 12 var ssl = loadTimeData.getBoolean('ssl'); |
| 13 | 13 |
| 14 if (ssl) { | 14 if (ssl) { |
| 15 $('body').classList.add('ssl'); | 15 $('body').classList.add('ssl'); |
| 16 setupSSLFinchTrial(); /* From ssl_errors_common.js. */ | 16 setupSSLFinchTrial(); /* From ssl_errors_common.js. */ |
| 17 $('error-code').textContent = loadTimeData.getString('errorCode'); | 17 $('error-code').textContent = loadTimeData.getString('errorCode'); |
| 18 $('error-code').classList.remove('hidden'); | 18 $('error-code').classList.remove('hidden'); |
| 19 } else { | 19 } else { |
| 20 $('body').classList.add('safe-browsing'); | 20 $('body').classList.add('safe-browsing'); |
| 21 setupMalwareFinchExperiment(); /* From safe_browsing_v3.js. */ | |
| 22 } | 21 } |
| 23 | 22 |
| 24 $('primary-button').addEventListener('click', function() { | 23 $('primary-button').addEventListener('click', function() { |
| 25 if (!ssl) | 24 if (!ssl) |
| 26 sendCommand(SB_CMD_TAKE_ME_BACK); | 25 sendCommand(SB_CMD_TAKE_ME_BACK); |
| 27 else if (overridable) | 26 else if (overridable) |
| 28 sendCommand(CMD_DONT_PROCEED); | 27 sendCommand(CMD_DONT_PROCEED); |
| 29 else | 28 else |
| 30 sendCommand(CMD_RELOAD); | 29 sendCommand(CMD_RELOAD); |
| 31 }); | 30 }); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); | 67 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); |
| 69 expandedDetails = true; | 68 expandedDetails = true; |
| 70 } | 69 } |
| 71 }); | 70 }); |
| 72 | 71 |
| 73 preventDefaultOnPoundLinkClicks(); | 72 preventDefaultOnPoundLinkClicks(); |
| 74 setupCheckbox(); | 73 setupCheckbox(); |
| 75 } | 74 } |
| 76 | 75 |
| 77 document.addEventListener('DOMContentLoaded', setupEvents); | 76 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |