Chromium Code Reviews| Index: chrome/browser/resources/security_warnings/interstitial_v2.js |
| diff --git a/chrome/browser/resources/security_warnings/interstitial_v2.js b/chrome/browser/resources/security_warnings/interstitial_v2.js |
| index 0da23b75ebbc62df85ffb1c03238e5d2cadaaa67..37f13bc27ce218227a53bc196096178abd10901b 100644 |
| --- a/chrome/browser/resources/security_warnings/interstitial_v2.js |
| +++ b/chrome/browser/resources/security_warnings/interstitial_v2.js |
| @@ -34,6 +34,35 @@ function handleKeypress(e) { |
| } |
| } |
| +/* |
|
Bernhard Bauer
2014/09/19 08:40:35
One more asterisk here to make this a JSDoc commen
felt
2014/09/20 15:47:02
Done.
|
| + * This appends a piece of debugging information to the end of the warning. |
| + * When complete, the caller must also make the debugging div |
| + * (error-debugging-info) visible. |
| + * @param {string} title The name of this debugging field. |
| + * @param {string} value The value of the debugging field. |
| + */ |
| +function appendDebuggingField(title, value) { |
| + // The values input here are not trusted. Never use innerHTML on these |
| + // values! |
| + var spanTitle = document.createElement('span'); |
| + spanTitle.classList.add('debugging-title'); |
| + spanTitle.innerText = title + ': '; |
| + |
| + var spanValue = document.createElement('span'); |
| + spanValue.classList.add('debugging-value'); |
| + spanValue.innerText = value; |
| + |
| + var pElem = document.createElement('p'); |
| + pElem.classList.add('debugging-par'); |
| + pElem.appendChild(spanTitle); |
| + pElem.appendChild(spanValue); |
| + $('error-debugging-info').appendChild(pElem); |
| +} |
| + |
| +function toggleDebuggingInfo() { |
| + $('error-debugging-info').classList.toggle('hidden'); |
| +} |
| + |
| function setupEvents() { |
| var overridable = loadTimeData.getBoolean('overridable'); |
| var ssl = loadTimeData.getBoolean('ssl'); |
| @@ -97,6 +126,7 @@ function setupEvents() { |
| preventDefaultOnPoundLinkClicks(); |
| setupCheckbox(); |
| + setupSSLDebuggingInfo(); |
| document.addEventListener('keypress', handleKeypress); |
| } |