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 9c96dfd843900188328837e9f35274e7c49014a4..c0ff0305bd74e470e0315963458d0ac1d22b4bf6 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js |
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js |
@@ -451,7 +451,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) { |
@@ -919,6 +919,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) |
+ return false; |
+ for (var i = 0; i < contextTypes.length; ++i) { |
+ if (contextType === this._module._manager._resolve(contextTypes[i])) |
+ return true; |
+ } |
+ return false; |
} |
} |