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

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

Issue 2347483002: [DevTools] Remove SidebarTreeElement from SecurityPanel. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
index fe15f998605358e7fdae942d34db96fa08ed268d..33492f7193ddd2d8f418d21de6731bd69114e8f9 100644
--- a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
@@ -381,18 +381,19 @@ WebInspector.SecurityPanelSidebarTree = function(mainViewElement, showOriginInPa
this._mainOrigin = null;
TreeOutlineInShadow.call(this);
- this.element.classList.add("sidebar-tree");
this.registerRequiredCSS("security/sidebar.css");
this.registerRequiredCSS("security/lockIcon.css");
this.appendChild(mainViewElement);
- /** @type {!Map<!WebInspector.SecurityPanelSidebarTree.OriginGroupName, !WebInspector.SidebarSectionTreeElement>} */
+ /** @type {!Map<!WebInspector.SecurityPanelSidebarTree.OriginGroupName, !TreeElement>} */
this._originGroups = new Map();
for (var key in WebInspector.SecurityPanelSidebarTree.OriginGroupName) {
var originGroupName = WebInspector.SecurityPanelSidebarTree.OriginGroupName[key];
- var originGroup = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString(originGroupName));
+ var originGroup = new TreeElement(WebInspector.UIString(originGroupName), true);
alph 2016/09/15 17:24:16 drop UIString.
dgozman 2016/09/15 17:25:51 I'll move it to the literal instead.
+ originGroup.selectable = false;
+ originGroup.expand();
originGroup.listItemElement.classList.add("security-sidebar-origins");
this._originGroups.set(originGroupName, originGroup);
this.appendChild(originGroup);
@@ -400,8 +401,9 @@ WebInspector.SecurityPanelSidebarTree = function(mainViewElement, showOriginInPa
this._clearOriginGroups();
// This message will be removed by clearOrigins() during the first new page load after the panel was opened.
- var mainViewReloadMessage = new WebInspector.SidebarTreeElement("security-main-view-reload-message", WebInspector.UIString("Reload to view details"));
+ var mainViewReloadMessage = new TreeElement(WebInspector.UIString("Reload to view details"));
mainViewReloadMessage.selectable = false;
+ mainViewReloadMessage.listItemElement.classList.add("security-main-view-reload-message");
this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.MainOrigin).appendChild(mainViewReloadMessage);
/** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPanelSidebarTreeElement>} */
@@ -515,7 +517,7 @@ WebInspector.SecurityPanelSidebarTree.OriginGroupName = {
/**
* @constructor
- * @extends {WebInspector.SidebarTreeElement}
+ * @extends {TreeElement}
* @param {string} text
* @param {function()} selectCallback
* @param {string} className
@@ -523,12 +525,13 @@ WebInspector.SecurityPanelSidebarTree.OriginGroupName = {
*/
WebInspector.SecurityPanelSidebarTreeElement = function(text, selectCallback, className, cssPrefix)
{
+ TreeElement.call(this, "", false);
this._selectCallback = selectCallback;
this._cssPrefix = cssPrefix;
-
- WebInspector.SidebarTreeElement.call(this, className, text);
- this.iconElement.classList.add(this._cssPrefix);
-
+ this.listItemElement.classList.add(className);
+ this._iconElement = this.listItemElement.createChild("div", "icon");
+ this._iconElement.classList.add(this._cssPrefix);
+ this.listItemElement.createChild("span", "title").textContent = text;
this.setSecurityState(SecurityAgent.SecurityState.Unknown);
}
@@ -539,10 +542,10 @@ WebInspector.SecurityPanelSidebarTreeElement.prototype = {
setSecurityState: function(newSecurityState)
{
if (this._securityState)
- this.iconElement.classList.remove(this._cssPrefix + "-" + this._securityState)
+ this._iconElement.classList.remove(this._cssPrefix + "-" + this._securityState);
this._securityState = newSecurityState;
- this.iconElement.classList.add(this._cssPrefix + "-" + newSecurityState);
+ this._iconElement.classList.add(this._cssPrefix + "-" + newSecurityState);
},
/**
@@ -563,7 +566,7 @@ WebInspector.SecurityPanelSidebarTreeElement.prototype = {
return true;
},
- __proto__: WebInspector.SidebarTreeElement.prototype
+ __proto__: TreeElement.prototype
}
/**

Powered by Google App Engine
This is Rietveld 408576698