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 } else { | 17 } else { |
17 $('body').classList.add('safe-browsing'); | 18 $('body').classList.add('safe-browsing'); |
18 setupMalwareFinchExperiment(); | 19 setupMalwareFinchExperiment(); /* From safe_browsing_v3.js. */ |
19 } | 20 } |
20 | 21 |
21 $('primary-button').addEventListener('click', function() { | 22 $('primary-button').addEventListener('click', function() { |
22 if (!ssl) | 23 if (!ssl) |
23 sendCommand(SB_CMD_TAKE_ME_BACK); | 24 sendCommand(SB_CMD_TAKE_ME_BACK); |
24 else if (overridable) | 25 else if (overridable) |
25 sendCommand(CMD_DONT_PROCEED); | 26 sendCommand(CMD_DONT_PROCEED); |
26 else | 27 else |
27 sendCommand(CMD_RELOAD); | 28 sendCommand(CMD_RELOAD); |
28 }); | 29 }); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); | 65 sendCommand(ssl ? CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); |
65 expandedDetails = true; | 66 expandedDetails = true; |
66 } | 67 } |
67 }); | 68 }); |
68 | 69 |
69 preventDefaultOnPoundLinkClicks(); | 70 preventDefaultOnPoundLinkClicks(); |
70 setupCheckbox(); | 71 setupCheckbox(); |
71 } | 72 } |
72 | 73 |
73 document.addEventListener('DOMContentLoaded', setupEvents); | 74 document.addEventListener('DOMContentLoaded', setupEvents); |
OLD | NEW |