| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 if (ssl) { | 102 if (ssl) { |
| 103 $('body').classList.add(badClock ? 'bad-clock' : 'ssl'); | 103 $('body').classList.add(badClock ? 'bad-clock' : 'ssl'); |
| 104 $('error-code').textContent = loadTimeData.getString('errorCode'); | 104 $('error-code').textContent = loadTimeData.getString('errorCode'); |
| 105 $('error-code').classList.remove('hidden'); | 105 $('error-code').classList.remove('hidden'); |
| 106 } else if (captivePortal) { | 106 } else if (captivePortal) { |
| 107 $('body').classList.add('captive-portal'); | 107 $('body').classList.add('captive-portal'); |
| 108 } else { | 108 } else { |
| 109 $('body').classList.add('safe-browsing'); | 109 $('body').classList.add('safe-browsing'); |
| 110 } | 110 } |
| 111 | 111 |
| 112 if (loadTimeData.getBoolean('iconUpdate') === true) |
| 113 $('icon').classList.add('new-icons'); |
| 114 else |
| 115 $('icon').classList.add('old-icons'); |
| 116 |
| 112 if (hidePrimaryButton) { | 117 if (hidePrimaryButton) { |
| 113 $('primary-button').classList.add('hidden'); | 118 $('primary-button').classList.add('hidden'); |
| 114 } else { | 119 } else { |
| 115 $('primary-button').addEventListener('click', function() { | 120 $('primary-button').addEventListener('click', function() { |
| 116 switch (interstitialType) { | 121 switch (interstitialType) { |
| 117 case 'CAPTIVE_PORTAL': | 122 case 'CAPTIVE_PORTAL': |
| 118 sendCommand(CMD_OPEN_LOGIN); | 123 sendCommand(CMD_OPEN_LOGIN); |
| 119 break; | 124 break; |
| 120 | 125 |
| 121 case 'SSL': | 126 case 'SSL': |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 }); | 197 }); |
| 193 } | 198 } |
| 194 | 199 |
| 195 preventDefaultOnPoundLinkClicks(); | 200 preventDefaultOnPoundLinkClicks(); |
| 196 setupExtendedReportingCheckbox(); | 201 setupExtendedReportingCheckbox(); |
| 197 setupSSLDebuggingInfo(); | 202 setupSSLDebuggingInfo(); |
| 198 document.addEventListener('keypress', handleKeypress); | 203 document.addEventListener('keypress', handleKeypress); |
| 199 } | 204 } |
| 200 | 205 |
| 201 document.addEventListener('DOMContentLoaded', setupEvents); | 206 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |