| 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 var keyPressState = 0; | 9 var keyPressState = 0; |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 function toggleDebuggingInfo() { | 95 function toggleDebuggingInfo() { |
| 96 $('error-debugging-info').classList.toggle('hidden'); | 96 $('error-debugging-info').classList.toggle('hidden'); |
| 97 } | 97 } |
| 98 | 98 |
| 99 function setupEvents() { | 99 function setupEvents() { |
| 100 var overridable = loadTimeData.getBoolean('overridable'); | 100 var overridable = loadTimeData.getBoolean('overridable'); |
| 101 var interstitialType = loadTimeData.getString('type'); | 101 var interstitialType = loadTimeData.getString('type'); |
| 102 var ssl = interstitialType == 'SSL'; | 102 var ssl = interstitialType == 'SSL'; |
| 103 var captivePortal = interstitialType == 'CAPTIVE_PORTAL'; | 103 var captivePortal = interstitialType == 'CAPTIVE_PORTAL'; |
| 104 var badClock = ssl && loadTimeData.getBoolean('bad_clock'); | 104 var badClock = ssl && loadTimeData.getBoolean('bad_clock'); |
| 105 var hidePrimaryButton = badClock && loadTimeData.getBoolean( | 105 var hidePrimaryButton = loadTimeData.getBoolean('hide_primary_button'); |
| 106 'hide_primary_button'); | |
| 107 | 106 |
| 108 if (ssl) { | 107 if (ssl) { |
| 109 $('body').classList.add(badClock ? 'bad-clock' : 'ssl'); | 108 $('body').classList.add(badClock ? 'bad-clock' : 'ssl'); |
| 110 $('error-code').textContent = loadTimeData.getString('errorCode'); | 109 $('error-code').textContent = loadTimeData.getString('errorCode'); |
| 111 $('error-code').classList.remove('hidden'); | 110 $('error-code').classList.remove('hidden'); |
| 112 } else if (captivePortal) { | 111 } else if (captivePortal) { |
| 113 $('body').classList.add('captive-portal'); | 112 $('body').classList.add('captive-portal'); |
| 114 } else { | 113 } else { |
| 115 $('body').classList.add('safe-browsing'); | 114 $('body').classList.add('safe-browsing'); |
| 116 } | 115 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 }); | 203 }); |
| 205 } | 204 } |
| 206 | 205 |
| 207 preventDefaultOnPoundLinkClicks(); | 206 preventDefaultOnPoundLinkClicks(); |
| 208 setupExtendedReportingCheckbox(); | 207 setupExtendedReportingCheckbox(); |
| 209 setupSSLDebuggingInfo(); | 208 setupSSLDebuggingInfo(); |
| 210 document.addEventListener('keypress', handleKeypress); | 209 document.addEventListener('keypress', handleKeypress); |
| 211 } | 210 } |
| 212 | 211 |
| 213 document.addEventListener('DOMContentLoaded', setupEvents); | 212 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |