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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.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/sources/ScopeChainSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
index bf8f41881ef1ca94ee528af5ee9c8c17861a519f..aef00c7de9ba854df751ba434672ec8f35c93971 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
@@ -26,36 +26,48 @@
/**
* @constructor
- * @extends {WebInspector.SimpleView}
+ * @extends {WebInspector.VBox}
+ * @implements {WebInspector.ContextFlavorListener}
*/
WebInspector.ScopeChainSidebarPane = function()
{
- WebInspector.SimpleView.call(this, WebInspector.UIString("Scope"));
+ WebInspector.VBox.call(this);
this._expandController = new WebInspector.ObjectPropertiesSectionExpandController();
this._linkifier = new WebInspector.Linkifier();
- WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.CallFrame, this._update, this);
+ this._update();
}
WebInspector.ScopeChainSidebarPane._pathSymbol = Symbol("path");
WebInspector.ScopeChainSidebarPane.prototype = {
+ /**
+ * @override
+ * @param {?Object} object
+ */
+ flavorChanged: function(object)
+ {
+ this._update();
+ },
+
_update: function()
{
var callFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame);
+ var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails);
this._linkifier.reset();
WebInspector.SourceMapNamesResolver.resolveThisObject(callFrame)
- .then(this._innerUpdate.bind(this, callFrame));
+ .then(this._innerUpdate.bind(this, details, callFrame));
},
/**
+ * @param {?WebInspector.DebuggerPausedDetails} details
* @param {?WebInspector.DebuggerModel.CallFrame} callFrame
* @param {?WebInspector.RemoteObject} thisObject
*/
- _innerUpdate: function(callFrame, thisObject)
+ _innerUpdate: function(details, callFrame, thisObject)
{
this.element.removeChildren();
- if (!callFrame) {
+ if (!details || !callFrame) {
var infoElement = createElement("div");
infoElement.className = "gray-info-message";
infoElement.textContent = WebInspector.UIString("Not Paused");
@@ -79,7 +91,6 @@ WebInspector.ScopeChainSidebarPane.prototype = {
if (thisObject)
extraProperties.push(new WebInspector.RemoteObjectProperty("this", thisObject));
if (i === 0) {
- var details = callFrame.debuggerModel.debuggerPausedDetails();
var exception = details.exception();
if (exception)
extraProperties.push(new WebInspector.RemoteObjectProperty(WebInspector.UIString.capitalize("Exception"), exception, undefined, undefined, undefined, undefined, undefined, true));
@@ -137,5 +148,5 @@ WebInspector.ScopeChainSidebarPane.prototype = {
_sidebarPaneUpdatedForTest: function() { },
- __proto__: WebInspector.SimpleView.prototype
+ __proto__: WebInspector.VBox.prototype
}

Powered by Google App Engine
This is Rietveld 408576698