Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: components/security_interstitials/core/browser/resources/interstitial_v2.js

Issue 2412993002: Make PEM debugging section fixed width in the SSL interstitial (Closed)
Patch Set: bool Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {boolean=} fixedWidth If true, the value field is displayed fixed
72 * width.
71 */ 73 */
72 function appendDebuggingField(title, value) { 74 function appendDebuggingField(title, value, fixedWidth) {
73 // The values input here are not trusted. Never use innerHTML on these 75 // The values input here are not trusted. Never use innerHTML on these
74 // values! 76 // values!
75 var spanTitle = document.createElement('span'); 77 var spanTitle = document.createElement('span');
76 spanTitle.classList.add('debugging-title'); 78 spanTitle.classList.add('debugging-title');
77 spanTitle.innerText = title + ': '; 79 spanTitle.innerText = title + ': ';
78 80
79 var spanValue = document.createElement('span'); 81 var spanValue = document.createElement('span');
80 spanValue.classList.add('debugging-value'); 82 spanValue.classList.add('debugging-content');
83 if (fixedWidth) {
84 spanValue.classList.add('debugging-content-fixed-width');
85 }
81 spanValue.innerText = value; 86 spanValue.innerText = value;
82 87
83 var pElem = document.createElement('p'); 88 var pElem = document.createElement('p');
84 pElem.classList.add('debugging-content'); 89 pElem.classList.add('debugging-content');
85 pElem.appendChild(spanTitle); 90 pElem.appendChild(spanTitle);
86 pElem.appendChild(spanValue); 91 pElem.appendChild(spanValue);
87 $('error-debugging-info').appendChild(pElem); 92 $('error-debugging-info').appendChild(pElem);
88 } 93 }
89 94
90 function toggleDebuggingInfo() { 95 function toggleDebuggingInfo() {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 }); 207 });
203 } 208 }
204 209
205 preventDefaultOnPoundLinkClicks(); 210 preventDefaultOnPoundLinkClicks();
206 setupExtendedReportingCheckbox(); 211 setupExtendedReportingCheckbox();
207 setupSSLDebuggingInfo(); 212 setupSSLDebuggingInfo();
208 document.addEventListener('keypress', handleKeypress); 213 document.addEventListener('keypress', handleKeypress);
209 } 214 }
210 215
211 document.addEventListener('DOMContentLoaded', setupEvents); 216 document.addEventListener('DOMContentLoaded', setupEvents);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698