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

Unified Diff: Source/devtools/front_end/Context.js

Issue 218613013: DevTools: Decouple shortcuts from actions, introduce shortcut contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased patch Created 6 years, 8 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 | « Source/devtools/front_end/AdvancedSearchView.js ('k') | Source/devtools/front_end/Dialog.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/Context.js
diff --git a/Source/devtools/front_end/Context.js b/Source/devtools/front_end/Context.js
index d8d46dd11ce20da4f469c179db070736f0433827..0029ab58b04364ed598360c24732107d2cbe4677 100644
--- a/Source/devtools/front_end/Context.js
+++ b/Source/devtools/front_end/Context.js
@@ -20,7 +20,7 @@ WebInspector.Context.Events = {
WebInspector.Context.prototype = {
/**
- * @param {function(new:T)} flavorType
+ * @param {function(new:T, ...)} flavorType
* @param {?T} flavorValue
* @template T
*/
@@ -38,7 +38,7 @@ WebInspector.Context.prototype = {
},
/**
- * @param {function(new:T)} flavorType
+ * @param {function(new:T, ...)} flavorType
* @param {?T} flavorValue
* @template T
*/
@@ -51,7 +51,7 @@ WebInspector.Context.prototype = {
},
/**
- * @param {function(new:Object)} flavorType
+ * @param {function(new:Object, ...)} flavorType
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
@@ -66,7 +66,7 @@ WebInspector.Context.prototype = {
},
/**
- * @param {function(new:Object)} flavorType
+ * @param {function(new:Object, ...)} flavorType
* @param {function(!WebInspector.Event)} listener
* @param {!Object=} thisObject
*/
@@ -81,7 +81,7 @@ WebInspector.Context.prototype = {
},
/**
- * @param {function(new:T)} flavorType
+ * @param {function(new:T, ...)} flavorType
* @return {?T}
* @template T
*/
@@ -91,11 +91,28 @@ WebInspector.Context.prototype = {
},
/**
- * @return {!Array.<function(new:Object)>}
+ * @return {!Array.<function(new:Object, ...)>}
*/
flavors: function()
{
return this._flavors.keys();
+ },
+
+ /**
+ * @param {!Array.<!WebInspector.ModuleManager.Extension>} extensions
+ * @return {!Set.<!WebInspector.ModuleManager.Extension>}
+ */
+ applicableExtensions: function(extensions)
+ {
+ var targetExtensionSet = new Set();
+
+ var availableFlavors = Set.fromArray(this.flavors());
+ extensions.forEach(function(extension) {
+ if (WebInspector.ModuleManager.isExtensionApplicableToContextTypes(extension, availableFlavors))
+ targetExtensionSet.add(extension);
+ });
+
+ return targetExtensionSet;
}
}
« no previous file with comments | « Source/devtools/front_end/AdvancedSearchView.js ('k') | Source/devtools/front_end/Dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698