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

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

Issue 1978323002: DevTools: reveal object path in console tooltip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments in patch 9 Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
index 16f51444c17c05de24247a83761837575339a2d0..b46e31b1d92bb7b024be40c34cad56ee1f7b6c04 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
@@ -350,16 +350,24 @@ WebInspector.ContextMenu.prototype = {
return this._id++;
},
+ /**
+ * @param {function()} callback
+ */
+ beforeShow: function(callback)
+ {
+ this._beforeShow = callback;
+ },
+
show: function()
{
- Promise.all(this._pendingPromises).then(populateAndShow.bind(this));
+ Promise.all(this._pendingPromises).then(populate.bind(this)).then(this._innerShow.bind(this));
WebInspector.ContextMenu._pendingMenu = this;
/**
* @param {!Array.<!Array.<!WebInspector.ContextMenu.Provider>>} appendCallResults
* @this {WebInspector.ContextMenu}
*/
- function populateAndShow(appendCallResults)
+ function populate(appendCallResults)
{
if (WebInspector.ContextMenu._pendingMenu !== this)
return;
@@ -379,7 +387,6 @@ WebInspector.ContextMenu.prototype = {
this._pendingPromises = [];
this._pendingTargets = [];
- this._innerShow();
}
this._event.consume(true);
@@ -393,6 +400,11 @@ WebInspector.ContextMenu.prototype = {
_innerShow: function()
{
+ if (typeof this._beforeShow === "function") {
+ this._beforeShow();
+ delete this._beforeShow;
+ }
+
var menuObject = this._buildDescriptors();
WebInspector._contextMenu = this;
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698