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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.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/XHRBreakpointsSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js
index 0e228dd5add1220aadc4742bb6cec1c50fce8484..9acc0a31f10848e3c51a5296d4699ee26cef39e1 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js
@@ -5,6 +5,7 @@
/**
* @constructor
* @extends {WebInspector.BreakpointsSidebarPaneBase}
+ * @implements {WebInspector.ContextFlavorListener}
* @implements {WebInspector.TargetManager.Observer}
* @implements {WebInspector.ToolbarItem.ItemsProvider}
*/
@@ -20,8 +21,8 @@ WebInspector.XHRBreakpointsSidebarPane = function()
this._addButton.addEventListener("click", this._addButtonClicked.bind(this));
this.emptyElement.addEventListener("contextmenu", this._emptyElementContextMenu.bind(this), true);
-
WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser);
+ this._update();
}
WebInspector.XHRBreakpointsSidebarPane.prototype = {
@@ -61,7 +62,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = {
if (event)
event.consume();
- WebInspector.viewManager.revealViewWithWidget(this);
+ WebInspector.viewManager.showView("sources.xhrBreakpoints");
var inputElementContainer = createElementWithClass("p", "breakpoint-condition");
inputElementContainer.textContent = WebInspector.UIString("Break when URL contains:");
@@ -223,10 +224,16 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = {
/**
* @override
- * @param {?WebInspector.DebuggerPausedDetails} details
+ * @param {?Object} object
*/
- highlightDetails: function(details)
+ flavorChanged: function(object)
+ {
+ this._update();
+ },
+
+ _update: function()
{
+ var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails);
if (!details || details.reason !== WebInspector.DebuggerModel.BreakReason.XHR) {
if (this._highlightedElement) {
this._highlightedElement.classList.remove("breakpoint-hit");
@@ -238,7 +245,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = {
var element = this._breakpointElements.get(url);
if (!element)
return;
- WebInspector.viewManager.revealViewWithWidget(this);
+ WebInspector.viewManager.showView("sources.xhrBreakpoints");
element.classList.add("breakpoint-hit");
this._highlightedElement = element;
},

Powered by Google App Engine
This is Rietveld 408576698