Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 keyPressState = 0; | 61 keyPressState = 0; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * This appends a piece of debugging information to the end of the warning. | 66 * This appends a piece of debugging information to the end of the warning. |
| 67 * When complete, the caller must also make the debugging div | 67 * When complete, the caller must also make the debugging div |
| 68 * (error-debugging-info) visible. | 68 * (error-debugging-info) visible. |
| 69 * @param {string} title The name of this debugging field. | 69 * @param {string} title The name of this debugging field. |
| 70 * @param {string} value The value of the debugging field. | 70 * @param {string} value The value of the debugging field. |
| 71 * @param {string=} extraCssClass Additional CSS classes. Optional. | |
|
lgarron
2016/10/14 21:33:05
Nit: I just noticed that this is an incorrect plur
meacer
2016/10/14 21:44:37
Changed the param to a boolean and renamed it.
| |
| 71 */ | 72 */ |
| 72 function appendDebuggingField(title, value) { | 73 function appendDebuggingField(title, value, extraCssClass) { |
|
felt
2016/10/14 21:32:33
Do you plan to use this for other things in the fu
meacer
2016/10/14 21:44:37
Not sure if we'll need new stuff, but to keep it s
| |
| 73 // The values input here are not trusted. Never use innerHTML on these | 74 // The values input here are not trusted. Never use innerHTML on these |
| 74 // values! | 75 // values! |
| 75 var spanTitle = document.createElement('span'); | 76 var spanTitle = document.createElement('span'); |
| 76 spanTitle.classList.add('debugging-title'); | 77 spanTitle.classList.add('debugging-title'); |
| 77 spanTitle.innerText = title + ': '; | 78 spanTitle.innerText = title + ': '; |
| 78 | 79 |
| 79 var spanValue = document.createElement('span'); | 80 var spanValue = document.createElement('span'); |
| 80 spanValue.classList.add('debugging-value'); | 81 spanValue.classList.add('debugging-value'); |
| 82 if (extraCssClass) { | |
| 83 spanValue.classList.add(extraCssClass); | |
| 84 } | |
| 81 spanValue.innerText = value; | 85 spanValue.innerText = value; |
| 82 | 86 |
| 83 var pElem = document.createElement('p'); | 87 var pElem = document.createElement('p'); |
| 84 pElem.classList.add('debugging-content'); | 88 pElem.classList.add('debugging-content'); |
| 85 pElem.appendChild(spanTitle); | 89 pElem.appendChild(spanTitle); |
| 86 pElem.appendChild(spanValue); | 90 pElem.appendChild(spanValue); |
| 87 $('error-debugging-info').appendChild(pElem); | 91 $('error-debugging-info').appendChild(pElem); |
| 88 } | 92 } |
| 89 | 93 |
| 90 function toggleDebuggingInfo() { | 94 function toggleDebuggingInfo() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 }); | 206 }); |
| 203 } | 207 } |
| 204 | 208 |
| 205 preventDefaultOnPoundLinkClicks(); | 209 preventDefaultOnPoundLinkClicks(); |
| 206 setupExtendedReportingCheckbox(); | 210 setupExtendedReportingCheckbox(); |
| 207 setupSSLDebuggingInfo(); | 211 setupSSLDebuggingInfo(); |
| 208 document.addEventListener('keypress', handleKeypress); | 212 document.addEventListener('keypress', handleKeypress); |
| 209 } | 213 } |
| 210 | 214 |
| 211 document.addEventListener('DOMContentLoaded', setupEvents); | 215 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |