| 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() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (overridable) { | 31 if (overridable) { |
| 32 $('proceed-link').addEventListener('click', function(event) { | 32 $('proceed-link').addEventListener('click', function(event) { |
| 33 sendCommand(ssl ? CMD_PROCEED : SB_CMD_PROCEED); | 33 sendCommand(ssl ? CMD_PROCEED : SB_CMD_PROCEED); |
| 34 }); | 34 }); |
| 35 } else if (!ssl) { | 35 } else if (!ssl) { |
| 36 $('final-paragraph').classList.add('hidden'); | 36 $('final-paragraph').classList.add('hidden'); |
| 37 } | 37 } |
| 38 | 38 |
| 39 if (ssl && overridable) { | 39 if (ssl && overridable) { |
| 40 $('proceed-link').classList.add('small-link'); | 40 $('proceed-link').classList.add('small-link'); |
| 41 } else { | 41 } else if ($('help-link')) { |
| 42 // Overridable SSL page doesn't have this link. | 42 // Overridable SSL page doesn't have this link. |
| 43 $('help-link').addEventListener('click', function(event) { | 43 $('help-link').addEventListener('click', function(event) { |
| 44 if (ssl) | 44 if (ssl) |
| 45 sendCommand(CMD_HELP); | 45 sendCommand(CMD_HELP); |
| 46 else if (loadTimeData.getBoolean('phishing')) | 46 else if (loadTimeData.getBoolean('phishing')) |
| 47 sendCommand(SB_CMD_LEARN_MORE_2); | 47 sendCommand(SB_CMD_LEARN_MORE_2); |
| 48 else | 48 else |
| 49 sendCommand(SB_CMD_SHOW_DIAGNOSTIC); | 49 sendCommand(SB_CMD_SHOW_DIAGNOSTIC); |
| 50 }); | 50 }); |
| 51 } | 51 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 71 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); | 71 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); |
| 72 expandedDetails = true; | 72 expandedDetails = true; |
| 73 } | 73 } |
| 74 }); | 74 }); |
| 75 | 75 |
| 76 preventDefaultOnPoundLinkClicks(); | 76 preventDefaultOnPoundLinkClicks(); |
| 77 setupCheckbox(); | 77 setupCheckbox(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 document.addEventListener('DOMContentLoaded', setupEvents); | 80 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |