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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js

Issue 2234193002: DevTools: migrate some of the sources panel sidebar panes to view management, allow view toolbars. (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/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 2126ac1eb21a93fb05b01c7251e63c45297e975a..7e9c1d0932143accf6cb30b716795826e637c27a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -36,23 +36,23 @@ WebInspector.CallStackSidebarPane = function()
this.callFrameList.show(this.element);
this._linkifier = new WebInspector.Linkifier();
WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this._asyncStackTracesStateChanged, this);
- WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._blackboxingStateChanged, this);
+ WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._update, this);
/** @type {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} */
this.callFrames = [];
this._locationPool = new WebInspector.LiveLocationPool();
-}
-
-/** @enum {string} */
-WebInspector.CallStackSidebarPane.Events = {
- CallFrameSelected: "CallFrameSelected",
+ WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._update, this);
+ WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._update, this);
+ WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._update, this);
+ WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.CallFrame, this._updateCallFrame, this);
}
WebInspector.CallStackSidebarPane.prototype = {
- /**
- * @param {?WebInspector.DebuggerPausedDetails} details
- */
- update: function(details)
+ _update: function()
{
+ var target = WebInspector.context.flavor(WebInspector.Target);
+ var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
+ var details = debuggerModel ? debuggerModel.debuggerPausedDetails() : null;
+
this.callFrameList.detach();
this.callFrameList.clear();
this._linkifier.reset();
@@ -101,6 +101,7 @@ WebInspector.CallStackSidebarPane.prototype = {
this.element.insertBefore(element, this.element.firstChild);
this._hiddenCallFramesMessageElement = element;
}
+ WebInspector.viewManager.revealViewWithWidget(this);
},
/**
@@ -248,19 +249,6 @@ WebInspector.CallStackSidebarPane.prototype = {
}
},
- _blackboxingStateChanged: function()
- {
- if (!this._debuggerModel)
- return;
- var details = this._debuggerModel.debuggerPausedDetails();
- if (!details)
- return;
- this.update(details);
- var selectedCallFrame = this._debuggerModel.selectedCallFrame();
- if (selectedCallFrame)
- this.setSelectedCallFrame(selectedCallFrame);
- },
-
_asyncStackTracesStateChanged: function()
{
var enabled = WebInspector.moduleSetting("enableAsyncStackTraces").get();
@@ -288,14 +276,12 @@ WebInspector.CallStackSidebarPane.prototype = {
this._selectNextVisibleCallFrame(0);
},
- /**
- * @param {!WebInspector.DebuggerModel.CallFrame} x
- */
- setSelectedCallFrame: function(x)
+ _updateCallFrame: function()
{
+ var selectedCallFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame);
for (var i = 0; i < this.callFrames.length; ++i) {
var callFrame = this.callFrames[i];
- callFrame.setSelected(callFrame._debuggerCallFrame === x);
+ callFrame.setSelected(callFrame._debuggerCallFrame === selectedCallFrame);
if (callFrame.isSelected() && callFrame.isHidden())
this._revealHiddenCallFrames();
}
@@ -375,7 +361,7 @@ WebInspector.CallStackSidebarPane.prototype = {
callFrameItem.element.scrollIntoViewIfNeeded();
var callFrame = callFrameItem._debuggerCallFrame;
if (callFrame)
- this.dispatchEventToListeners(WebInspector.CallStackSidebarPane.Events.CallFrameSelected, callFrame);
+ callFrame.debuggerModel.setSelectedCallFrame(callFrame);
},
_copyStackTrace: function()

Powered by Google App Engine
This is Rietveld 408576698