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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js

Issue 2881513003: DevTools: Convert Security Panel to Sentence case (Closed)
Patch Set: Fix hardcoded UnitTest Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * @implements {SDK.SDKModelObserver<!Security.SecurityModel>} 5 * @implements {SDK.SDKModelObserver<!Security.SecurityModel>}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Security.SecurityPanel = class extends UI.PanelWithSidebar { 8 Security.SecurityPanel = class extends UI.PanelWithSidebar {
9 constructor() { 9 constructor() {
10 super('security'); 10 super('security');
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 this._elementsByOrigin.clear(); 491 this._elementsByOrigin.clear();
492 } 492 }
493 }; 493 };
494 494
495 /** 495 /**
496 * A mapping from Javascript key IDs to names (sidebar section titles). 496 * A mapping from Javascript key IDs to names (sidebar section titles).
497 * Note: The names are used as keys into a map, so they must be distinct from ea ch other. 497 * Note: The names are used as keys into a map, so they must be distinct from ea ch other.
498 * @enum {string} 498 * @enum {string}
499 */ 499 */
500 Security.SecurityPanelSidebarTree.OriginGroupName = { 500 Security.SecurityPanelSidebarTree.OriginGroupName = {
501 MainOrigin: Common.UIString('Main Origin'), 501 MainOrigin: Common.UIString('Main origin'),
502 NonSecure: Common.UIString('Non-Secure Origins'), 502 NonSecure: Common.UIString('Non-secure origins'),
503 Secure: Common.UIString('Secure Origins'), 503 Secure: Common.UIString('Secure origins'),
504 Unknown: Common.UIString('Unknown / Canceled') 504 Unknown: Common.UIString('Unknown / canceled')
505 }; 505 };
506 506
507 /** 507 /**
508 * @unrestricted 508 * @unrestricted
509 */ 509 */
510 Security.SecurityPanelSidebarTreeElement = class extends UI.TreeElement { 510 Security.SecurityPanelSidebarTreeElement = class extends UI.TreeElement {
511 /** 511 /**
512 * @param {string} text 512 * @param {string} text
513 * @param {function()} selectCallback 513 * @param {function()} selectCallback
514 * @param {string} className 514 * @param {string} className
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 this._summarySection = this.contentElement.createChild('div', 'security-summ ary'); 583 this._summarySection = this.contentElement.createChild('div', 'security-summ ary');
584 584
585 // Info explanations should appear after all others. 585 // Info explanations should appear after all others.
586 this._securityExplanationsMain = this.contentElement.createChild('div', 'sec urity-explanation-list'); 586 this._securityExplanationsMain = this.contentElement.createChild('div', 'sec urity-explanation-list');
587 this._securityExplanationsExtra = 587 this._securityExplanationsExtra =
588 this.contentElement.createChild('div', 'security-explanation-list securi ty-explanations-extra'); 588 this.contentElement.createChild('div', 'security-explanation-list securi ty-explanations-extra');
589 589
590 // Fill the security summary section. 590 // Fill the security summary section.
591 this._summarySection.createChild('div', 'security-summary-section-title').te xtContent = 591 this._summarySection.createChild('div', 'security-summary-section-title').te xtContent =
592 Common.UIString('Security Overview'); 592 Common.UIString('Security overview');
593 593
594 var lockSpectrum = this._summarySection.createChild('div', 'lock-spectrum'); 594 var lockSpectrum = this._summarySection.createChild('div', 'lock-spectrum');
595 lockSpectrum.createChild('div', 'lock-icon lock-icon-secure').title = Common .UIString('Secure'); 595 lockSpectrum.createChild('div', 'lock-icon lock-icon-secure').title = Common .UIString('Secure');
596 lockSpectrum.createChild('div', 'lock-icon lock-icon-neutral').title = Commo n.UIString('Not Secure'); 596 lockSpectrum.createChild('div', 'lock-icon lock-icon-neutral').title = Commo n.UIString('Not secure');
597 lockSpectrum.createChild('div', 'lock-icon lock-icon-insecure').title = Comm on.UIString('Not Secure (Broken)'); 597 lockSpectrum.createChild('div', 'lock-icon lock-icon-insecure').title = Comm on.UIString('Not secure (broken)');
598 598
599 this._summarySection.createChild('div', 'triangle-pointer-container') 599 this._summarySection.createChild('div', 'triangle-pointer-container')
600 .createChild('div', 'triangle-pointer-wrapper') 600 .createChild('div', 'triangle-pointer-wrapper')
601 .createChild('div', 'triangle-pointer'); 601 .createChild('div', 'triangle-pointer');
602 602
603 this._summaryText = this._summarySection.createChild('div', 'security-summar y-text'); 603 this._summaryText = this._summarySection.createChild('div', 'security-summar y-text');
604 } 604 }
605 605
606 /** 606 /**
607 * @param {!Element} parent 607 * @param {!Element} parent
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 this._addMixedContentExplanations(); 673 this._addMixedContentExplanations();
674 this._addContentWithCertErrorsExplanations(); 674 this._addContentWithCertErrorsExplanations();
675 675
676 // If all resources were served securely, add a Secure explanation. 676 // If all resources were served securely, add a Secure explanation.
677 if (this._schemeIsCryptographic && this._insecureContentStatus && 677 if (this._schemeIsCryptographic && this._insecureContentStatus &&
678 (!this._insecureContentStatus.displayedMixedContent && !this._insecureCo ntentStatus.ranMixedContent && 678 (!this._insecureContentStatus.displayedMixedContent && !this._insecureCo ntentStatus.ranMixedContent &&
679 !this._insecureContentStatus.displayedContentWithCertErrors && 679 !this._insecureContentStatus.displayedContentWithCertErrors &&
680 !this._insecureContentStatus.ranContentWithCertErrors)) { 680 !this._insecureContentStatus.ranContentWithCertErrors)) {
681 this._addExplanation(this._securityExplanationsMain, /** @type {!Protocol. Security.SecurityStateExplanation} */ ({ 681 this._addExplanation(this._securityExplanationsMain, /** @type {!Protocol. Security.SecurityStateExplanation} */ ({
682 'securityState': Protocol.Security.SecurityState.Se cure, 682 'securityState': Protocol.Security.SecurityState.Se cure,
683 'summary': Common.UIString('Secure Resources'), 683 'summary': Common.UIString('Secure resources'),
684 'description': Common.UIString('All resources on th is page are served securely.') 684 'description': Common.UIString('All resources on th is page are served securely.')
685 })); 685 }));
686 } 686 }
687 } 687 }
688 688
689 _addMixedContentExplanations() { 689 _addMixedContentExplanations() {
690 if (!this._schemeIsCryptographic) 690 if (!this._schemeIsCryptographic)
691 return; 691 return;
692 692
693 if (this._insecureContentStatus && 693 if (this._insecureContentStatus &&
694 (this._insecureContentStatus.ranMixedContent || this._insecureContentSta tus.displayedMixedContent || 694 (this._insecureContentStatus.ranMixedContent || this._insecureContentSta tus.displayedMixedContent ||
695 this._insecureContentStatus.containedMixedForm)) { 695 this._insecureContentStatus.containedMixedForm)) {
696 if (this._insecureContentStatus.ranMixedContent) { 696 if (this._insecureContentStatus.ranMixedContent) {
697 this._addMixedContentExplanation( 697 this._addMixedContentExplanation(
698 this._securityExplanationsMain, this._insecureContentStatus.ranInsec ureContentStyle, 698 this._securityExplanationsMain, this._insecureContentStatus.ranInsec ureContentStyle,
699 Common.UIString('Active Mixed Content'), 699 Common.UIString('Active mixed content'),
700 Common.UIString( 700 Common.UIString(
701 'You have recently allowed non-secure content (such as scripts o r iframes) to run on this site.'), 701 'You have recently allowed non-secure content (such as scripts o r iframes) to run on this site.'),
702 Network.NetworkLogView.MixedContentFilterValues.BlockOverridden, 702 Network.NetworkLogView.MixedContentFilterValues.BlockOverridden,
703 showBlockOverriddenMixedContentInNetworkPanel); 703 showBlockOverriddenMixedContentInNetworkPanel);
704 } 704 }
705 if (this._insecureContentStatus.containedMixedForm) { 705 if (this._insecureContentStatus.containedMixedForm) {
706 this._addMixedFormExplanation( 706 this._addMixedFormExplanation(
707 // TODO(elawrence): Replace |displayedInsecureContentStyle| with |co ntainedMixedFormStyle|. https://crbug.com/705003 707 // TODO(elawrence): Replace |displayedInsecureContentStyle| with |co ntainedMixedFormStyle|. https://crbug.com/705003
708 this._securityExplanationsMain, this._insecureContentStatus.displaye dInsecureContentStyle, 708 this._securityExplanationsMain, this._insecureContentStatus.displaye dInsecureContentStyle,
709 Common.UIString('Non-secure Form'), 709 Common.UIString('Non-secure form'),
710 Common.UIString('The page includes a form with a non-secure "action" attribute.')); 710 Common.UIString('The page includes a form with a non-secure "action" attribute.'));
711 } 711 }
712 if (this._insecureContentStatus.displayedMixedContent) { 712 if (this._insecureContentStatus.displayedMixedContent) {
713 this._addMixedContentExplanation( 713 this._addMixedContentExplanation(
714 this._securityExplanationsMain, this._insecureContentStatus.displaye dInsecureContentStyle, 714 this._securityExplanationsMain, this._insecureContentStatus.displaye dInsecureContentStyle,
715 Common.UIString('Mixed Content'), Common.UIString('The site includes HTTP resources.'), 715 Common.UIString('Mixed content'), Common.UIString('The site includes HTTP resources.'),
716 Network.NetworkLogView.MixedContentFilterValues.Displayed, showDispl ayedMixedContentInNetworkPanel); 716 Network.NetworkLogView.MixedContentFilterValues.Displayed, showDispl ayedMixedContentInNetworkPanel);
717 } 717 }
718 } 718 }
719 719
720 if (this._panel.filterRequestCount(Network.NetworkLogView.MixedContentFilter Values.Blocked) > 0) { 720 if (this._panel.filterRequestCount(Network.NetworkLogView.MixedContentFilter Values.Blocked) > 0) {
721 this._addMixedContentExplanation( 721 this._addMixedContentExplanation(
722 this._securityExplanationsExtra, Protocol.Security.SecurityState.Info, 722 this._securityExplanationsExtra, Protocol.Security.SecurityState.Info,
723 Common.UIString('Blocked mixed content'), 723 Common.UIString('Blocked mixed content'),
724 Common.UIString('Your page requested non-secure resources that were bl ocked.'), 724 Common.UIString('Your page requested non-secure resources that were bl ocked.'),
725 Network.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedMi xedContentInNetworkPanel); 725 Network.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedMi xedContentInNetworkPanel);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 ]); 870 ]);
871 } 871 }
872 originNetworkLink.addEventListener('click', showOriginRequestsInNetworkPanel , false); 872 originNetworkLink.addEventListener('click', showOriginRequestsInNetworkPanel , false);
873 873
874 if (originState.securityDetails) { 874 if (originState.securityDetails) {
875 var connectionSection = this.element.createChild('div', 'origin-view-secti on'); 875 var connectionSection = this.element.createChild('div', 'origin-view-secti on');
876 connectionSection.createChild('div', 'origin-view-section-title').textCont ent = Common.UIString('Connection'); 876 connectionSection.createChild('div', 'origin-view-section-title').textCont ent = Common.UIString('Connection');
877 877
878 var table = new Security.SecurityDetailsTable(); 878 var table = new Security.SecurityDetailsTable();
879 connectionSection.appendChild(table.element()); 879 connectionSection.appendChild(table.element());
880 table.addRow('Protocol', originState.securityDetails.protocol); 880 table.addRow(Common.UIString('Protocol'), originState.securityDetails.prot ocol);
881 if (originState.securityDetails.keyExchange) 881 if (originState.securityDetails.keyExchange)
882 table.addRow('Key Exchange', originState.securityDetails.keyExchange); 882 table.addRow(Common.UIString('Key exchange'), originState.securityDetail s.keyExchange);
883 if (originState.securityDetails.keyExchangeGroup) 883 if (originState.securityDetails.keyExchangeGroup)
884 table.addRow('Key Exchange Group', originState.securityDetails.keyExchan geGroup); 884 table.addRow(Common.UIString('Key exchange group'), originState.security Details.keyExchangeGroup);
885 table.addRow( 885 table.addRow(
886 'Cipher', originState.securityDetails.cipher + 886 Common.UIString('Cipher'), originState.securityDetails.cipher +
887 (originState.securityDetails.mac ? ' with ' + originState.security Details.mac : '')); 887 (originState.securityDetails.mac ? ' with ' + originState.security Details.mac : ''));
888 888
889 // Create the certificate section outside the callback, so that it appears in the right place. 889 // Create the certificate section outside the callback, so that it appears in the right place.
890 var certificateSection = this.element.createChild('div', 'origin-view-sect ion'); 890 var certificateSection = this.element.createChild('div', 'origin-view-sect ion');
891 certificateSection.createChild('div', 'origin-view-section-title').textCon tent = Common.UIString('Certificate'); 891 certificateSection.createChild('div', 'origin-view-section-title').textCon tent = Common.UIString('Certificate');
892 892
893 if (originState.securityDetails.signedCertificateTimestampList.length) { 893 if (originState.securityDetails.signedCertificateTimestampList.length) {
894 // Create the Certificate Transparency section outside the callback, so that it appears in the right place. 894 // Create the Certificate Transparency section outside the callback, so that it appears in the right place.
895 var sctSection = this.element.createChild('div', 'origin-view-section'); 895 var sctSection = this.element.createChild('div', 'origin-view-section');
896 sctSection.createChild('div', 'origin-view-section-title').textContent = 896 sctSection.createChild('div', 'origin-view-section-title').textContent =
897 Common.UIString('Certificate Transparency'); 897 Common.UIString('Certificate Transparency');
898 } 898 }
899 899
900 var sanDiv = this._createSanDiv(originState.securityDetails.sanList); 900 var sanDiv = this._createSanDiv(originState.securityDetails.sanList);
901 var validFromString = new Date(1000 * originState.securityDetails.validFro m).toUTCString(); 901 var validFromString = new Date(1000 * originState.securityDetails.validFro m).toUTCString();
902 var validUntilString = new Date(1000 * originState.securityDetails.validTo ).toUTCString(); 902 var validUntilString = new Date(1000 * originState.securityDetails.validTo ).toUTCString();
903 903
904 table = new Security.SecurityDetailsTable(); 904 table = new Security.SecurityDetailsTable();
905 certificateSection.appendChild(table.element()); 905 certificateSection.appendChild(table.element());
906 table.addRow(Common.UIString('Subject'), originState.securityDetails.subje ctName); 906 table.addRow(Common.UIString('Subject'), originState.securityDetails.subje ctName);
907 table.addRow(Common.UIString('SAN'), sanDiv); 907 table.addRow(Common.UIString('SAN'), sanDiv);
908 table.addRow(Common.UIString('Valid From'), validFromString); 908 table.addRow(Common.UIString('Valid from'), validFromString);
909 table.addRow(Common.UIString('Valid Until'), validUntilString); 909 table.addRow(Common.UIString('Valid until'), validUntilString);
910 table.addRow(Common.UIString('Issuer'), originState.securityDetails.issuer ); 910 table.addRow(Common.UIString('Issuer'), originState.securityDetails.issuer );
911 table.addRow( 911 table.addRow(
912 '', Security.SecurityPanel.createCertificateViewerButton2( 912 '', Security.SecurityPanel.createCertificateViewerButton2(
913 Common.UIString('Open full certificate details'), origin)); 913 Common.UIString('Open full certificate details'), origin));
914 914
915 if (!originState.securityDetails.signedCertificateTimestampList.length) 915 if (!originState.securityDetails.signedCertificateTimestampList.length)
916 return; 916 return;
917 917
918 // Show summary of SCT(s) of Certificate Transparency. 918 // Show summary of SCT(s) of Certificate Transparency.
919 var sctSummaryTable = new Security.SecurityDetailsTable(); 919 var sctSummaryTable = new Security.SecurityDetailsTable();
920 sctSummaryTable.element().classList.add('sct-summary'); 920 sctSummaryTable.element().classList.add('sct-summary');
921 sctSection.appendChild(sctSummaryTable.element()); 921 sctSection.appendChild(sctSummaryTable.element());
922 for (var i = 0; i < originState.securityDetails.signedCertificateTimestamp List.length; i++) { 922 for (var i = 0; i < originState.securityDetails.signedCertificateTimestamp List.length; i++) {
923 var sct = originState.securityDetails.signedCertificateTimestampList[i]; 923 var sct = originState.securityDetails.signedCertificateTimestampList[i];
924 sctSummaryTable.addRow( 924 sctSummaryTable.addRow(
925 Common.UIString('SCT'), sct.logDescription + ' (' + sct.origin + ', ' + sct.status + ')'); 925 Common.UIString('SCT'), sct.logDescription + ' (' + sct.origin + ', ' + sct.status + ')');
926 } 926 }
927 927
928 // Show detailed SCT(s) of Certificate Transparency. 928 // Show detailed SCT(s) of Certificate Transparency.
929 var sctTableWrapper = sctSection.createChild('div', 'sct-details'); 929 var sctTableWrapper = sctSection.createChild('div', 'sct-details');
930 sctTableWrapper.classList.add('hidden'); 930 sctTableWrapper.classList.add('hidden');
931 for (var i = 0; i < originState.securityDetails.signedCertificateTimestamp List.length; i++) { 931 for (var i = 0; i < originState.securityDetails.signedCertificateTimestamp List.length; i++) {
932 var sctTable = new Security.SecurityDetailsTable(); 932 var sctTable = new Security.SecurityDetailsTable();
933 sctTableWrapper.appendChild(sctTable.element()); 933 sctTableWrapper.appendChild(sctTable.element());
934 var sct = originState.securityDetails.signedCertificateTimestampList[i]; 934 var sct = originState.securityDetails.signedCertificateTimestampList[i];
935 sctTable.addRow(Common.UIString('Log Name'), sct.logDescription); 935 sctTable.addRow(Common.UIString('Log name'), sct.logDescription);
936 sctTable.addRow(Common.UIString('Log ID'), sct.logId.replace(/(.{2})/g, '$1 ')); 936 sctTable.addRow(Common.UIString('Log ID'), sct.logId.replace(/(.{2})/g, '$1 '));
937 sctTable.addRow(Common.UIString('Validation Status'), sct.status); 937 sctTable.addRow(Common.UIString('Validation status'), sct.status);
938 sctTable.addRow(Common.UIString('Source'), sct.origin); 938 sctTable.addRow(Common.UIString('Source'), sct.origin);
939 sctTable.addRow(Common.UIString('Issued At'), new Date(sct.timestamp).to UTCString()); 939 sctTable.addRow(Common.UIString('Issued at'), new Date(sct.timestamp).to UTCString());
940 sctTable.addRow(Common.UIString('Hash Algorithm'), sct.hashAlgorithm); 940 sctTable.addRow(Common.UIString('Hash algorithm'), sct.hashAlgorithm);
941 sctTable.addRow(Common.UIString('Signature Algorithm'), sct.signatureAlg orithm); 941 sctTable.addRow(Common.UIString('Signature algorithm'), sct.signatureAlg orithm);
942 sctTable.addRow(Common.UIString('Signature Data'), sct.signatureData.rep lace(/(.{2})/g, '$1 ')); 942 sctTable.addRow(Common.UIString('Signature data'), sct.signatureData.rep lace(/(.{2})/g, '$1 '));
943 } 943 }
944 944
945 // Add link to toggle between displaying of the summary of the SCT(s) and the detailed SCT(s). 945 // Add link to toggle between displaying of the summary of the SCT(s) and the detailed SCT(s).
946 var toggleSctsDetailsLink = sctSection.createChild('div', 'link'); 946 var toggleSctsDetailsLink = sctSection.createChild('div', 'link');
947 toggleSctsDetailsLink.classList.add('sct-toggle'); 947 toggleSctsDetailsLink.classList.add('sct-toggle');
948 toggleSctsDetailsLink.textContent = Common.UIString('Show full details'); 948 toggleSctsDetailsLink.textContent = Common.UIString('Show full details');
949 function toggleSctDetailsDisplay() { 949 function toggleSctDetailsDisplay() {
950 var isDetailsShown = !sctTableWrapper.classList.contains('hidden'); 950 var isDetailsShown = !sctTableWrapper.classList.contains('hidden');
951 if (isDetailsShown) 951 if (isDetailsShown)
952 toggleSctsDetailsLink.textContent = Common.UIString('Show full details '); 952 toggleSctsDetailsLink.textContent = Common.UIString('Show full details ');
953 else 953 else
954 toggleSctsDetailsLink.textContent = Common.UIString('Hide full details '); 954 toggleSctsDetailsLink.textContent = Common.UIString('Hide full details ');
955 sctSummaryTable.element().classList.toggle('hidden'); 955 sctSummaryTable.element().classList.toggle('hidden');
956 sctTableWrapper.classList.toggle('hidden'); 956 sctTableWrapper.classList.toggle('hidden');
957 } 957 }
958 toggleSctsDetailsLink.addEventListener('click', toggleSctDetailsDisplay, f alse); 958 toggleSctsDetailsLink.addEventListener('click', toggleSctDetailsDisplay, f alse);
959 959
960 var noteSection = this.element.createChild('div', 'origin-view-section'); 960 var noteSection = this.element.createChild('div', 'origin-view-section');
961 // TODO(lgarron): Fix the issue and then remove this section. See comment in SecurityPanel._processRequest(). 961 // TODO(lgarron): Fix the issue and then remove this section. See comment in SecurityPanel._processRequest().
962 noteSection.createChild('div').textContent = 962 noteSection.createChild('div').textContent =
963 Common.UIString('The security details above are from the first inspect ed response.'); 963 Common.UIString('The security details above are from the first inspect ed response.');
964 } else if (originState.securityState !== Protocol.Security.SecurityState.Unk nown) { 964 } else if (originState.securityState !== Protocol.Security.SecurityState.Unk nown) {
965 var notSecureSection = this.element.createChild('div', 'origin-view-sectio n'); 965 var notSecureSection = this.element.createChild('div', 'origin-view-sectio n');
966 notSecureSection.createChild('div', 'origin-view-section-title').textConte nt = Common.UIString('Not Secure'); 966 notSecureSection.createChild('div', 'origin-view-section-title').textConte nt = Common.UIString('Not secure');
967 notSecureSection.createChild('div').textContent = 967 notSecureSection.createChild('div').textContent =
968 Common.UIString('Your connection to this origin is not secure.'); 968 Common.UIString('Your connection to this origin is not secure.');
969 } else { 969 } else {
970 var noInfoSection = this.element.createChild('div', 'origin-view-section') ; 970 var noInfoSection = this.element.createChild('div', 'origin-view-section') ;
971 noInfoSection.createChild('div', 'origin-view-section-title').textContent = 971 noInfoSection.createChild('div', 'origin-view-section-title').textContent =
972 Common.UIString('No Security Information'); 972 Common.UIString('No security information');
973 noInfoSection.createChild('div').textContent = 973 noInfoSection.createChild('div').textContent =
974 Common.UIString('No security details are available for this origin.'); 974 Common.UIString('No security details are available for this origin.');
975 } 975 }
976 } 976 }
977 977
978 /** 978 /**
979 * @param {!Array<string>} sanList 979 * @param {!Array<string>} sanList
980 * *return {!Element} 980 * *return {!Element}
981 */ 981 */
982 _createSanDiv(sanList) { 982 _createSanDiv(sanList) {
983 var sanDiv = createElement('div'); 983 var sanDiv = createElement('div');
984 if (sanList.length === 0) { 984 if (sanList.length === 0) {
985 sanDiv.textContent = Common.UIString('(N/A)'); 985 sanDiv.textContent = Common.UIString('(n/a)');
pfeldman 2017/05/19 19:50:38 I think it is common for N/A to be caps.
986 sanDiv.classList.add('empty-san'); 986 sanDiv.classList.add('empty-san');
987 } else { 987 } else {
988 var truncatedNumToShow = 2; 988 var truncatedNumToShow = 2;
989 var listIsTruncated = sanList.length > truncatedNumToShow + 1; 989 var listIsTruncated = sanList.length > truncatedNumToShow + 1;
990 for (var i = 0; i < sanList.length; i++) { 990 for (var i = 0; i < sanList.length; i++) {
991 var span = sanDiv.createChild('span', 'san-entry'); 991 var span = sanDiv.createChild('span', 'san-entry');
992 span.textContent = sanList[i]; 992 span.textContent = sanList[i];
993 if (listIsTruncated && i >= truncatedNumToShow) 993 if (listIsTruncated && i >= truncatedNumToShow)
994 span.classList.add('truncated-entry'); 994 span.classList.add('truncated-entry');
995 } 995 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 var row = this._element.createChild('div', 'details-table-row'); 1050 var row = this._element.createChild('div', 'details-table-row');
1051 row.createChild('div').textContent = key; 1051 row.createChild('div').textContent = key;
1052 1052
1053 var valueDiv = row.createChild('div'); 1053 var valueDiv = row.createChild('div');
1054 if (typeof value === 'string') 1054 if (typeof value === 'string')
1055 valueDiv.textContent = value; 1055 valueDiv.textContent = value;
1056 else 1056 else
1057 valueDiv.appendChild(value); 1057 valueDiv.appendChild(value);
1058 } 1058 }
1059 }; 1059 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698