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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Context.js

Issue 2238003002: DevTools: migrate sources panel sidebar to views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 4 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
Index: third_party/WebKit/Source/devtools/front_end/ui/Context.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Context.js b/third_party/WebKit/Source/devtools/front_end/ui/Context.js
index 9ee5fb851e64f8c3b8108a579ea36717ab994a8d..c657cb1910030bf54d5cbb905b8bf9b58603dc85 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Context.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Context.js
@@ -44,6 +44,10 @@ WebInspector.Context.prototype = {
*/
_dispatchFlavorChange: function(flavorType, flavorValue)
{
+ self.runtime.extensions(WebInspector.ContextFlavorListener, flavorValue).map(extension => {
+ extension.instance().then(instance => /** @type {!WebInspector.ContextFlavorListener} */ (instance).flavorChanged(flavorValue));
+ });
+
var dispatcher = this._eventDispatchers.get(flavorType);
if (!dispatcher)
return;
@@ -116,4 +120,16 @@ WebInspector.Context.prototype = {
}
}
+/**
+ * @interface
+ */
+WebInspector.ContextFlavorListener = function() { }
+
+WebInspector.ContextFlavorListener.prototype = {
+ /**
+ * @param {?Object} object
+ */
+ flavorChanged: function(object) { }
+}
+
WebInspector.context = new WebInspector.Context();

Powered by Google App Engine
This is Rietveld 408576698