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

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: Fixes. 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..165fb11e0658f41d66038199056a53bcfab5dda9 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.treeElement.representedObject;
+ var obj = {"method": logItem.method};
+ if (logItem.params)
+ obj.params = logItem.params;
+ showCallback(WebInspector.RemoteObject.fromLocalObject(obj), false);
+ },
+
__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");
caseq 2014/06/11 16:48:36 This change is probably redundant now.
malch 2014/06/11 16:50:44 We need this to properly show the popover. On 2014
var textContent = logItem.method;
if (logItem.params)
textContent += "(" + this._paramsToString(logItem.params) + ")";
- title.appendChild(document.createTextNode(textContent));
+ span.textContent = textContent;
this.title = title;
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698