Index: third_party/WebKit/Source/devtools/front_end/Runtime.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js |
index c26a193ad380b5aed356807a16ea934dead10272..909bbc5b261b4ecf77a71a6f24248e3210a4056f 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js |
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js |
@@ -453,7 +453,7 @@ Runtime.prototype = { |
{ |
if (!predicate) |
return false; |
- var contextTypes = /** @type {!Array.<string>|undefined} */ (extension.descriptor().contextTypes); |
+ var contextTypes = extension.descriptor().contextTypes; |
if (!contextTypes) |
return true; |
for (var i = 0; i < contextTypes.length; ++i) { |
@@ -921,6 +921,22 @@ Runtime.Extension.prototype = { |
{ |
// FIXME: should be WebInspector.UIString() but runtime is not l10n aware yet. |
return this._descriptor["title-" + Runtime._platform] || this._descriptor["title"]; |
+ }, |
+ |
+ /** |
+ * @param {function(new:Object)} contextType |
+ * @return {boolean} |
+ */ |
+ hasContextType: function(contextType) |
+ { |
+ var contextTypes = this.descriptor().contextTypes; |
+ if (!contextTypes) |
alph
2016/09/06 23:07:13
nit:
return contextTypes && contextTypes.some(type
|
+ return false; |
+ for (var i = 0; i < contextTypes.length; ++i) { |
+ if (contextType === this._module._manager._resolve(contextTypes[i])) |
+ return true; |
+ } |
+ return false; |
} |
} |