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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.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/sources/CallStackSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
index 7eb7293b91c51450988ffb334350ecf7dce94a9c..fe46c3678d9818e8e55d44c35c8ce29a5767ff0c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -23,22 +23,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
- * @implements {WebInspector.ContextFlavorListener}
+ * @implements {UI.ContextFlavorListener}
* @unrestricted
*/
-WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
+Sources.CallStackSidebarPane = class extends UI.SimpleView {
constructor() {
- super(WebInspector.UIString('Call Stack'));
+ super(Common.UIString('Call Stack'));
this.element.addEventListener('keydown', this._keyDown.bind(this), true);
this.element.tabIndex = 0;
- this.callFrameList = new WebInspector.UIList();
+ this.callFrameList = new Sources.UIList();
this.callFrameList.show(this.element);
- this._linkifier = new WebInspector.Linkifier();
- WebInspector.moduleSetting('enableAsyncStackTraces').addChangeListener(this._asyncStackTracesStateChanged, this);
- WebInspector.moduleSetting('skipStackFramesPattern').addChangeListener(this._update, this);
- /** @type {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} */
+ this._linkifier = new Components.Linkifier();
+ Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this._asyncStackTracesStateChanged, this);
+ Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._update, this);
+ /** @type {!Array<!Sources.CallStackSidebarPane.CallFrame>} */
this.callFrames = [];
- this._locationPool = new WebInspector.LiveLocationPool();
+ this._locationPool = new Bindings.LiveLocationPool();
this._update();
}
@@ -51,7 +51,7 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
_update() {
- var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails);
+ var details = UI.context.flavor(SDK.DebuggerPausedDetails);
this.callFrameList.detach();
this.callFrameList.clear();
@@ -66,8 +66,8 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
if (!details) {
var infoElement = this.element.createChild('div', 'gray-info-message');
- infoElement.textContent = WebInspector.UIString('Not Paused');
- WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame, null);
+ infoElement.textContent = Common.UIString('Not Paused');
+ UI.context.setFlavor(SDK.DebuggerModel.CallFrame, null);
return;
}
this._debuggerModel = details.debuggerModel;
@@ -82,13 +82,13 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
if (asyncStackTrace.description === 'async function') {
var lastPreviousFrame = peviousStackTrace[peviousStackTrace.length - 1];
var topFrame = asyncStackTrace.callFrames[0];
- var lastPreviousFrameName = WebInspector.beautifyFunctionName(lastPreviousFrame.functionName);
- var topFrameName = WebInspector.beautifyFunctionName(topFrame.functionName);
+ var lastPreviousFrameName = UI.beautifyFunctionName(lastPreviousFrame.functionName);
+ var topFrameName = UI.beautifyFunctionName(topFrame.functionName);
title = topFrameName + ' awaits ' + lastPreviousFrameName;
} else {
- title = WebInspector.asyncStackTraceLabel(asyncStackTrace.description);
+ title = UI.asyncStackTraceLabel(asyncStackTrace.description);
}
- var asyncCallFrame = new WebInspector.UIList.Item(title, '', true);
+ var asyncCallFrame = new Sources.UIList.Item(title, '', true);
asyncCallFrame.setHoverable(false);
asyncCallFrame.element.addEventListener(
'contextmenu', this._asyncCallFrameContextMenu.bind(this, this.callFrames.length), true);
@@ -103,13 +103,13 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
if (this._hiddenCallFrames) {
var element = createElementWithClass('div', 'hidden-callframes-message');
if (this._hiddenCallFrames === 1)
- element.textContent = WebInspector.UIString('1 stack frame is hidden (black-boxed).');
+ element.textContent = Common.UIString('1 stack frame is hidden (black-boxed).');
else
element.textContent =
- WebInspector.UIString('%d stack frames are hidden (black-boxed).', this._hiddenCallFrames);
+ Common.UIString('%d stack frames are hidden (black-boxed).', this._hiddenCallFrames);
element.createTextChild(' ');
var showAllLink = element.createChild('span', 'link');
- showAllLink.textContent = WebInspector.UIString('Show');
+ showAllLink.textContent = Common.UIString('Show');
showAllLink.addEventListener('click', this._revealHiddenCallFrames.bind(this), false);
this.element.insertBefore(element, this.element.firstChild);
this._hiddenCallFramesMessageElement = element;
@@ -119,14 +119,14 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames
- * @return {!Array<!WebInspector.CallStackSidebarPane.CallFrame>}
+ * @param {!Array.<!SDK.DebuggerModel.CallFrame>} callFrames
+ * @return {!Array<!Sources.CallStackSidebarPane.CallFrame>}
*/
_callFramesFromDebugger(callFrames) {
var callFrameItems = [];
for (var i = 0, n = callFrames.length; i < n; ++i) {
var callFrame = callFrames[i];
- var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame(
+ var callFrameItem = new Sources.CallStackSidebarPane.CallFrame(
callFrame.functionName, callFrame.location(), this._linkifier, callFrame, this._locationPool);
callFrameItem.element.addEventListener('click', this._callFrameSelected.bind(this, callFrameItem), false);
callFrameItems.push(callFrameItem);
@@ -136,16 +136,16 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
/**
* @param {!Array<!Protocol.Runtime.CallFrame>} callFrames
- * @param {!WebInspector.UIList.Item} asyncCallFrameItem
- * @return {!Array<!WebInspector.CallStackSidebarPane.CallFrame>}
+ * @param {!Sources.UIList.Item} asyncCallFrameItem
+ * @return {!Array<!Sources.CallStackSidebarPane.CallFrame>}
*/
_callFramesFromRuntime(callFrames, asyncCallFrameItem) {
var callFrameItems = [];
for (var i = 0, n = callFrames.length; i < n; ++i) {
var callFrame = callFrames[i];
- var location = new WebInspector.DebuggerModel.Location(
+ var location = new SDK.DebuggerModel.Location(
this._debuggerModel, callFrame.scriptId, callFrame.lineNumber, callFrame.columnNumber);
- var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame(
+ var callFrameItem = new Sources.CallStackSidebarPane.CallFrame(
callFrame.functionName, location, this._linkifier, null, this._locationPool, asyncCallFrameItem);
callFrameItem.element.addEventListener('click', this._asyncCallFrameClicked.bind(this, callFrameItem), false);
callFrameItems.push(callFrameItem);
@@ -154,8 +154,8 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {!Array.<!WebInspector.CallStackSidebarPane.CallFrame>} callFrames
- * @param {!WebInspector.UIList.Item=} asyncCallFrameItem
+ * @param {!Array.<!Sources.CallStackSidebarPane.CallFrame>} callFrames
+ * @param {!Sources.UIList.Item=} asyncCallFrameItem
*/
_appendSidebarCallFrames(callFrames, asyncCallFrameItem) {
if (asyncCallFrameItem)
@@ -167,7 +167,7 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
callFrameItem.element.addEventListener('contextmenu', this._callFrameContextMenu.bind(this, callFrameItem), true);
this.callFrames.push(callFrameItem);
- if (WebInspector.blackboxManager.isBlackboxedRawLocation(callFrameItem._location)) {
+ if (Bindings.blackboxManager.isBlackboxedRawLocation(callFrameItem._location)) {
callFrameItem.setHidden(true);
callFrameItem.setDimmed(true);
++this._hiddenCallFrames;
@@ -204,19 +204,19 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {!WebInspector.CallStackSidebarPane.CallFrame} callFrame
+ * @param {!Sources.CallStackSidebarPane.CallFrame} callFrame
* @param {!Event} event
*/
_callFrameContextMenu(callFrame, event) {
- var contextMenu = new WebInspector.ContextMenu(event);
+ var contextMenu = new UI.ContextMenu(event);
var debuggerCallFrame = callFrame._debuggerCallFrame;
if (debuggerCallFrame)
contextMenu.appendItem(
- WebInspector.UIString.capitalize('Restart ^frame'), debuggerCallFrame.restart.bind(debuggerCallFrame));
+ Common.UIString.capitalize('Restart ^frame'), debuggerCallFrame.restart.bind(debuggerCallFrame));
- contextMenu.appendItem(WebInspector.UIString.capitalize('Copy ^stack ^trace'), this._copyStackTrace.bind(this));
+ contextMenu.appendItem(Common.UIString.capitalize('Copy ^stack ^trace'), this._copyStackTrace.bind(this));
- var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame._location);
+ var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame._location);
this.appendBlackboxURLContextMenuItems(contextMenu, uiLocation.uiSourceCode);
contextMenu.show();
@@ -237,44 +237,44 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @param {!UI.ContextMenu} contextMenu
+ * @param {!Workspace.UISourceCode} uiSourceCode
*/
appendBlackboxURLContextMenuItems(contextMenu, uiSourceCode) {
- var binding = WebInspector.persistence.binding(uiSourceCode);
+ var binding = Persistence.persistence.binding(uiSourceCode);
if (binding)
uiSourceCode = binding.network;
- if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem)
+ if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem)
return;
- var canBlackbox = WebInspector.blackboxManager.canBlackboxUISourceCode(uiSourceCode);
- var isBlackboxed = WebInspector.blackboxManager.isBlackboxedUISourceCode(uiSourceCode);
- var isContentScript = uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts;
+ var canBlackbox = Bindings.blackboxManager.canBlackboxUISourceCode(uiSourceCode);
+ var isBlackboxed = Bindings.blackboxManager.isBlackboxedUISourceCode(uiSourceCode);
+ var isContentScript = uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts;
- var manager = WebInspector.blackboxManager;
+ var manager = Bindings.blackboxManager;
if (canBlackbox) {
if (isBlackboxed)
contextMenu.appendItem(
- WebInspector.UIString.capitalize('Stop ^blackboxing'),
+ Common.UIString.capitalize('Stop ^blackboxing'),
manager.unblackboxUISourceCode.bind(manager, uiSourceCode));
else
contextMenu.appendItem(
- WebInspector.UIString.capitalize('Blackbox ^script'),
+ Common.UIString.capitalize('Blackbox ^script'),
manager.blackboxUISourceCode.bind(manager, uiSourceCode));
}
if (isContentScript) {
if (isBlackboxed)
contextMenu.appendItem(
- WebInspector.UIString.capitalize('Stop blackboxing ^all ^content ^scripts'),
+ Common.UIString.capitalize('Stop blackboxing ^all ^content ^scripts'),
manager.blackboxContentScripts.bind(manager));
else
contextMenu.appendItem(
- WebInspector.UIString.capitalize('Blackbox ^all ^content ^scripts'),
+ Common.UIString.capitalize('Blackbox ^all ^content ^scripts'),
manager.unblackboxContentScripts.bind(manager));
}
}
_asyncStackTracesStateChanged() {
- var enabled = WebInspector.moduleSetting('enableAsyncStackTraces').get();
+ var enabled = Common.moduleSetting('enableAsyncStackTraces').get();
if (!enabled && this.callFrames)
this._removeAsyncCallFrames();
}
@@ -352,15 +352,15 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {!WebInspector.CallStackSidebarPane.CallFrame} callFrameItem
+ * @param {!Sources.CallStackSidebarPane.CallFrame} callFrameItem
*/
_asyncCallFrameClicked(callFrameItem) {
- var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrameItem._location);
- WebInspector.Revealer.reveal(uiLocation);
+ var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrameItem._location);
+ Common.Revealer.reveal(uiLocation);
}
/**
- * @param {!WebInspector.CallStackSidebarPane.CallFrame} selectedCallFrame
+ * @param {!Sources.CallStackSidebarPane.CallFrame} selectedCallFrame
*/
_callFrameSelected(selectedCallFrame) {
selectedCallFrame.element.scrollIntoViewIfNeeded();
@@ -373,14 +373,14 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
this._revealHiddenCallFrames();
}
- var oldCallFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame);
+ var oldCallFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame);
if (oldCallFrame === callFrame) {
- var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location());
- WebInspector.Revealer.reveal(uiLocation);
+ var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location());
+ Common.Revealer.reveal(uiLocation);
return;
}
- WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame, callFrame);
+ UI.context.setFlavor(SDK.DebuggerModel.CallFrame, callFrame);
callFrame.debuggerModel.setSelectedCallFrame(callFrame);
}
@@ -400,13 +400,13 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
}
/**
- * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate
+ * @param {function(!Array.<!UI.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate
*/
registerShortcuts(registerShortcutDelegate) {
registerShortcutDelegate(
- WebInspector.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this));
+ Components.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this));
registerShortcutDelegate(
- WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame,
+ Components.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame,
this._selectPreviousCallFrameOnStack.bind(this));
}
@@ -422,25 +422,25 @@ WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView {
/**
* @unrestricted
*/
-WebInspector.CallStackSidebarPane.CallFrame = class extends WebInspector.UIList.Item {
+Sources.CallStackSidebarPane.CallFrame = class extends Sources.UIList.Item {
/**
* @param {string} functionName
- * @param {!WebInspector.DebuggerModel.Location} location
- * @param {!WebInspector.Linkifier} linkifier
- * @param {?WebInspector.DebuggerModel.CallFrame} debuggerCallFrame
- * @param {!WebInspector.LiveLocationPool} locationPool
- * @param {!WebInspector.UIList.Item=} asyncCallFrame
+ * @param {!SDK.DebuggerModel.Location} location
+ * @param {!Components.Linkifier} linkifier
+ * @param {?SDK.DebuggerModel.CallFrame} debuggerCallFrame
+ * @param {!Bindings.LiveLocationPool} locationPool
+ * @param {!Sources.UIList.Item=} asyncCallFrame
*/
constructor(functionName, location, linkifier, debuggerCallFrame, locationPool, asyncCallFrame) {
- super(WebInspector.beautifyFunctionName(functionName), '');
+ super(UI.beautifyFunctionName(functionName), '');
this._location = location;
this._debuggerCallFrame = debuggerCallFrame;
this._asyncCallFrame = asyncCallFrame;
- WebInspector.debuggerWorkspaceBinding.createCallFrameLiveLocation(location, this._update.bind(this), locationPool);
+ Bindings.debuggerWorkspaceBinding.createCallFrameLiveLocation(location, this._update.bind(this), locationPool);
}
/**
- * @param {!WebInspector.LiveLocation} liveLocation
+ * @param {!Bindings.LiveLocation} liveLocation
*/
_update(liveLocation) {
var uiLocation = liveLocation.uiLocation();

Powered by Google App Engine
This is Rietveld 408576698