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

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

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 5b6196a232a059248597da4024448560b7399d0e..7be8c1d1c45fdf3a0960a6c819aa89987b706018 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Context.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Context.js
@@ -4,7 +4,7 @@
/**
* @unrestricted
*/
-WebInspector.Context = class {
+UI.Context = class {
constructor() {
this._flavors = new Map();
this._eventDispatchers = new Map();
@@ -33,42 +33,42 @@ WebInspector.Context = class {
* @template T
*/
_dispatchFlavorChange(flavorType, flavorValue) {
- for (var extension of self.runtime.extensions(WebInspector.ContextFlavorListener)) {
+ for (var extension of self.runtime.extensions(UI.ContextFlavorListener)) {
if (extension.hasContextType(flavorType))
extension.instance().then(
- instance => /** @type {!WebInspector.ContextFlavorListener} */ (instance).flavorChanged(flavorValue));
+ instance => /** @type {!UI.ContextFlavorListener} */ (instance).flavorChanged(flavorValue));
}
var dispatcher = this._eventDispatchers.get(flavorType);
if (!dispatcher)
return;
- dispatcher.dispatchEventToListeners(WebInspector.Context.Events.FlavorChanged, flavorValue);
+ dispatcher.dispatchEventToListeners(UI.Context.Events.FlavorChanged, flavorValue);
}
/**
* @param {function(new:Object, ...)} flavorType
- * @param {function(!WebInspector.Event)} listener
+ * @param {function(!Common.Event)} listener
* @param {!Object=} thisObject
*/
addFlavorChangeListener(flavorType, listener, thisObject) {
var dispatcher = this._eventDispatchers.get(flavorType);
if (!dispatcher) {
- dispatcher = new WebInspector.Object();
+ dispatcher = new Common.Object();
this._eventDispatchers.set(flavorType, dispatcher);
}
- dispatcher.addEventListener(WebInspector.Context.Events.FlavorChanged, listener, thisObject);
+ dispatcher.addEventListener(UI.Context.Events.FlavorChanged, listener, thisObject);
}
/**
* @param {function(new:Object, ...)} flavorType
- * @param {function(!WebInspector.Event)} listener
+ * @param {function(!Common.Event)} listener
* @param {!Object=} thisObject
*/
removeFlavorChangeListener(flavorType, listener, thisObject) {
var dispatcher = this._eventDispatchers.get(flavorType);
if (!dispatcher)
return;
- dispatcher.removeEventListener(WebInspector.Context.Events.FlavorChanged, listener, thisObject);
- if (!dispatcher.hasEventListeners(WebInspector.Context.Events.FlavorChanged))
+ dispatcher.removeEventListener(UI.Context.Events.FlavorChanged, listener, thisObject);
+ if (!dispatcher.hasEventListeners(UI.Context.Events.FlavorChanged))
this._eventDispatchers.remove(flavorType);
}
@@ -106,20 +106,20 @@ WebInspector.Context = class {
};
/** @enum {symbol} */
-WebInspector.Context.Events = {
+UI.Context.Events = {
FlavorChanged: Symbol('FlavorChanged')
};
/**
* @interface
*/
-WebInspector.ContextFlavorListener = function() {};
+UI.ContextFlavorListener = function() {};
-WebInspector.ContextFlavorListener.prototype = {
+UI.ContextFlavorListener.prototype = {
/**
* @param {?Object} object
*/
flavorChanged: function(object) {}
};
-WebInspector.context = new WebInspector.Context();
+UI.context = new UI.Context();

Powered by Google App Engine
This is Rietveld 408576698