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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js

Issue 2580163002: DevTools: migrate navigator icons to UI.Icon (Closed)
Patch Set: fix formatting Created 4 years 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/ui/treeoutline.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
index 8755e42582864edcee8e228bd7b2492e2d2dd1db..00db255fcad1ddc430afa7e4654cdaedbb00a733 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
@@ -602,7 +602,8 @@ var TreeElement = class {
this._listItemNode.removeChildren();
if (this._iconElement)
this._listItemNode.appendChild(this._iconElement);
-
+ if (this._leadingIconsElement)
+ this._listItemNode.appendChild(this._leadingIconsElement);
this._listItemNode.appendChild(this._titleElement);
if (this._trailingIconsElement)
this._listItemNode.appendChild(this._trailingIconsElement);
@@ -639,11 +640,27 @@ var TreeElement = class {
/**
* @param {!Array<!UI.Icon>} icons
*/
+ setLeadingIcons(icons) {
+ if (!this._leadingIconsElement && !icons.length)
+ return;
+ if (!this._leadingIconsElement) {
+ this._leadingIconsElement = createElementWithClass('div', 'leading-icons');
+ this._listItemNode.insertBefore(this._leadingIconsElement, this._titleElement);
+ this._ensureSelection();
+ }
+ this._leadingIconsElement.removeChildren();
+ for (var icon of icons)
+ this._leadingIconsElement.appendChild(icon);
+ }
+
+ /**
+ * @param {!Array<!UI.Icon>} icons
+ */
setTrailingIcons(icons) {
if (!this._trailingIconsElement && !icons.length)
return;
if (!this._trailingIconsElement) {
- this._trailingIconsElement = createElementWithClass('div', 'icons-container');
+ this._trailingIconsElement = createElementWithClass('div', 'trailing-icons');
this._listItemNode.appendChild(this._trailingIconsElement);
this._ensureSelection();
}

Powered by Google App Engine
This is Rietveld 408576698