OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.PanelWithSidebar} | 7 * @extends {WebInspector.PanelWithSidebar} |
8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
9 */ | 9 */ |
10 WebInspector.SecurityPanel = function() | 10 WebInspector.SecurityPanel = function() |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 */ | 349 */ |
350 _addExplanation: function(explanation) | 350 _addExplanation: function(explanation) |
351 { | 351 { |
352 var explanationSection = this._securityExplanations.createChild("div", "
security-section"); | 352 var explanationSection = this._securityExplanations.createChild("div", "
security-section"); |
353 explanationSection.classList.add("security-explanation"); | 353 explanationSection.classList.add("security-explanation"); |
354 | 354 |
355 explanationSection.createChild("div", "lock-icon").classList.add("lock-i
con-" + explanation.securityState); | 355 explanationSection.createChild("div", "lock-icon").classList.add("lock-i
con-" + explanation.securityState); |
356 var text = explanationSection.createChild("div", "security-section-text"
); | 356 var text = explanationSection.createChild("div", "security-section-text"
); |
357 text.createChild("div", "security-section-title").textContent = explanat
ion.summary; | 357 text.createChild("div", "security-section-title").textContent = explanat
ion.summary; |
358 text.createChild("div", "security-explanation").textContent = explanatio
n.description; | 358 text.createChild("div", "security-explanation").textContent = explanatio
n.description; |
359 if ("certificateId" in explanation) { | |
360 var certificateAnchor = text.createChild("div", "security-certificat
e-id link"); | |
361 certificateAnchor.textContent = WebInspector.UIString("View certific
ate"); | |
362 certificateAnchor.href = ""; | |
363 certificateAnchor.addEventListener("click", showCertificateViewer, f
alse); | |
364 } | |
365 /** | |
366 * @param {!Event} e | |
367 */ | |
368 function showCertificateViewer(e) | |
369 { | |
370 e.consume(); | |
371 WebInspector.targetManager.mainTarget().networkManager.showCertifica
teViewer(/** @type {number} */ (explanation.certificateId)); | |
372 } | |
373 }, | 359 }, |
374 | 360 |
375 /** | 361 /** |
376 * @param {!SecurityAgent.SecurityState} newSecurityState | 362 * @param {!SecurityAgent.SecurityState} newSecurityState |
377 * @param {!Array<!SecurityAgent.SecurityStateExplanation>} explanations | 363 * @param {!Array<!SecurityAgent.SecurityStateExplanation>} explanations |
378 */ | 364 */ |
379 updateSecurityState: function(newSecurityState, explanations) | 365 updateSecurityState: function(newSecurityState, explanations) |
380 { | 366 { |
381 // Remove old state. | 367 // Remove old state. |
382 // It's safe to call this even when this._securityState is undefined. | 368 // It's safe to call this even when this._securityState is undefined. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 526 |
541 var valueDiv = row.createChild("div"); | 527 var valueDiv = row.createChild("div"); |
542 if (value instanceof HTMLDivElement) { | 528 if (value instanceof HTMLDivElement) { |
543 valueDiv.appendChild(value); | 529 valueDiv.appendChild(value); |
544 } else { | 530 } else { |
545 valueDiv.textContent = value; | 531 valueDiv.textContent = value; |
546 } | 532 } |
547 } | 533 } |
548 } | 534 } |
549 | 535 |
OLD | NEW |