Chromium Code Reviews| 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 e6a37eddd4c5baae142401ea76881f1de64ac0fb..9e145f78edf4a0b36ee8917c0a8a6e42083f92dc 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js |
| @@ -6,18 +6,18 @@ |
| * @constructor |
| * @extends {WebInspector.BreakpointsSidebarPaneBase} |
| * @implements {WebInspector.TargetManager.Observer} |
| + * @implements {WebInspector.ToolbarItem.ItemsProvider} |
| */ |
| WebInspector.XHRBreakpointsSidebarPane = function() |
| { |
| - WebInspector.BreakpointsSidebarPaneBase.call(this, WebInspector.UIString("XHR Breakpoints")); |
| + WebInspector.BreakpointsSidebarPaneBase.call(this); |
| this._xhrBreakpointsSetting = WebInspector.settings.createLocalSetting("xhrBreakpoints", []); |
| /** @type {!Map.<string, !Element>} */ |
| this._breakpointElements = new Map(); |
| - var addButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add breakpoint"), "add-toolbar-item"); |
| - addButton.addEventListener("click", this._addButtonClicked.bind(this)); |
| - this.addToolbarItem(addButton); |
| + this._addButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add breakpoint"), "add-toolbar-item"); |
| + this._addButton.addEventListener("click", this._addButtonClicked.bind(this)); |
| this.emptyElement.addEventListener("contextmenu", this._emptyElementContextMenu.bind(this), true); |
| @@ -40,6 +40,15 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = { |
| */ |
| targetRemoved: function(target) { }, |
| + /** |
| + * @override |
| + * @return {!Array<!WebInspector.ToolbarItem>} |
| + */ |
| + toolbarItems: function() |
| + { |
| + return [this._addButton]; |
| + }, |
| + |
| _emptyElementContextMenu: function(event) |
| { |
| var contextMenu = new WebInspector.ContextMenu(event); |
| @@ -52,7 +61,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = { |
| if (event) |
| event.consume(); |
| - this.revealView(); |
| + WebInspector.viewManager.revealViewWithWidget(this); |
| var inputElementContainer = createElementWithClass("p", "breakpoint-condition"); |
| inputElementContainer.textContent = WebInspector.UIString("Break when URL contains:"); |
| @@ -212,16 +221,27 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = { |
| WebInspector.InplaceEditor.startEditing(inputElement, new WebInspector.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false))); |
| }, |
| - highlightBreakpoint: function(url) |
| + /** |
| + * @override |
| + * @param {!WebInspector.DebuggerPausedDetails} details |
| + */ |
| + highlightDetails: function(details) |
| { |
| + WebInspector.BreakpointsSidebarPaneBase.prototype.highlightDetails.call(this, details); |
|
dgozman
2016/08/11 01:42:16
Remove.
|
| + if (details.reason !== WebInspector.DebuggerModel.BreakReason.XHR) |
| + return; |
| + var url = details.auxData["breakpointURL"]; |
| var element = this._breakpointElements.get(url); |
| if (!element) |
| return; |
| - this.revealView(); |
| + WebInspector.viewManager.revealViewWithWidget(this); |
| element.classList.add("breakpoint-hit"); |
| this._highlightedElement = element; |
| }, |
| + /** |
| + * @override |
| + */ |
| clearBreakpointHighlight: function() |
| { |
| if (this._highlightedElement) { |