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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Runtime.js

Issue 2314503005: DevTools: remove UISourceCodeFrame from context when switching panels. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698