| 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 5b988e9ef007f84be2540b5730cbb3224d7d61d1..f30bea1741433cf41deecda0305b7d0773add5da 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
|
| @@ -301,6 +301,7 @@ WebInspector.ContextMenu = function(event, useSoftMenu, x, y)
|
| WebInspector.ContextSubMenuItem.call(this, this, "");
|
| /** @type {!Array.<!Promise.<!Array.<!WebInspector.ContextMenu.Provider>>>} */
|
| this._pendingPromises = [];
|
| + this._adapterPromises = [];
|
| /** @type {!Array.<!Promise.<!Object>>} */
|
| this._pendingTargets = [];
|
| this._event = event;
|
| @@ -352,8 +353,14 @@ WebInspector.ContextMenu.prototype = {
|
|
|
| show: function()
|
| {
|
| - Promise.all(this._pendingPromises).then(populateAndShow.bind(this));
|
| + Promise.all(this._adapterPromises).then(this._showWithProviders.bind(this));
|
| WebInspector.ContextMenu._pendingMenu = this;
|
| + this._event.consume(true);
|
| + },
|
| +
|
| + _showWithProviders: function()
|
| + {
|
| + Promise.all(this._pendingPromises).then(populateAndShow.bind(this));
|
|
|
| /**
|
| * @param {!Array.<!Array.<!WebInspector.ContextMenu.Provider>>} appendCallResults
|
| @@ -381,8 +388,6 @@ WebInspector.ContextMenu.prototype = {
|
| this._pendingTargets = [];
|
| this._innerShow();
|
| }
|
| -
|
| - this._event.consume(true);
|
| },
|
|
|
| discard: function()
|
| @@ -458,6 +463,19 @@ WebInspector.ContextMenu.prototype = {
|
| {
|
| this._pendingPromises.push(self.runtime.instancesPromise(WebInspector.ContextMenu.Provider, target));
|
| this._pendingTargets.push(target);
|
| +
|
| + this._adapterPromises.push(self.runtime.adapt(target).then(appendForAdapted.bind(this)));
|
| + /**
|
| + * @param {!Array<!Object>} adapted
|
| + * @this {WebInspector.ContextSubMenuItem}
|
| + */
|
| + function appendForAdapted(adapted)
|
| + {
|
| + for (var object of adapted) {
|
| + this._pendingPromises.push(self.runtime.instancesPromise(WebInspector.ContextMenu.Provider, object));
|
| + this._pendingTargets.push(object);
|
| + }
|
| + }
|
| },
|
|
|
| __proto__: WebInspector.ContextSubMenuItem.prototype
|
|
|