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

Unified Diff: Source/devtools/front_end/layers/PaintProfilerView.js

Issue 328113005: DevTools: Add popover for snapshot canvas log. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/devtools/front_end/layers/PaintProfilerView.js
diff --git a/Source/devtools/front_end/layers/PaintProfilerView.js b/Source/devtools/front_end/layers/PaintProfilerView.js
index f71f1167c2204626057d26912b8a2ff096fe4bd1..79d00eb11284f85d687bd50d6fe550cef13fe099 100644
--- a/Source/devtools/front_end/layers/PaintProfilerView.js
+++ b/Source/devtools/front_end/layers/PaintProfilerView.js
@@ -205,6 +205,7 @@ WebInspector.PaintProfilerCommandLogView = function()
this.element.classList.add("outline-disclosure");
var sidebarTreeElement = this.element.createChild("ol", "sidebar-tree");
this.sidebarTree = new TreeOutline(sidebarTreeElement);
+ this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.element, this._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefined, true);
this._log = [];
}
@@ -231,6 +232,29 @@ WebInspector.PaintProfilerCommandLogView.prototype = {
}
},
+ /**
+ * @param {!Element} target
+ * @return {!Element}
+ */
+ _getHoverAnchor: function(target)
+ {
+ return target.enclosingNodeOrSelfWithNodeName("span");
+ },
+
+ /**
+ * @param {!Element} element
+ * @param {function(!WebInspector.RemoteObject, boolean=, !Element=):undefined} showCallback
+ */
+ _resolveObjectForPopover: function(element, showCallback)
+ {
+ var liElement = element.enclosingNodeOrSelfWithNodeName("li");
+ var logItem = liElement.__logItem;
caseq 2014/06/11 16:03:21 can you use liElement.treeElement.representedObjec
malch 2014/06/11 16:32:58 Done.
+ var obj = {"method": liElement.__logItem.method};
+ if (logItem.params)
+ obj.params = logItem.params;
+ showCallback(WebInspector.RemoteObject.fromLocalObject(obj));
+ },
+
__proto__: WebInspector.VBox.prototype
};
@@ -287,10 +311,11 @@ WebInspector.LogTreeElement.prototype = {
var logItem = this.representedObject;
var title = document.createDocumentFragment();
title.createChild("div", "selection");
+ var span = title.createChild("span");
var textContent = logItem.method;
if (logItem.params)
textContent += "(" + this._paramsToString(logItem.params) + ")";
- title.appendChild(document.createTextNode(textContent));
+ span.textContent = textContent;
this.title = title;
},
@@ -302,5 +327,10 @@ WebInspector.LogTreeElement.prototype = {
this.listItemElement.classList.toggle("hovered", hovered);
},
+ onattach: function()
+ {
+ this.listItemElement.__logItem = this.representedObject;
caseq 2014/06/11 16:03:21 ...you won't need this then.
malch 2014/06/11 16:32:58 Done.
+ },
+
__proto__: TreeElement.prototype
};

Powered by Google App Engine
This is Rietveld 408576698