| 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..0e228dd5add1220aadc4742bb6cec1c50fce8484 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,24 +221,28 @@ 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)
|
| {
|
| + if (!details || details.reason !== WebInspector.DebuggerModel.BreakReason.XHR) {
|
| + if (this._highlightedElement) {
|
| + this._highlightedElement.classList.remove("breakpoint-hit");
|
| + delete this._highlightedElement;
|
| + }
|
| + 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;
|
| },
|
|
|
| - clearBreakpointHighlight: function()
|
| - {
|
| - if (this._highlightedElement) {
|
| - this._highlightedElement.classList.remove("breakpoint-hit");
|
| - delete this._highlightedElement;
|
| - }
|
| - },
|
| -
|
| _saveBreakpoints: function()
|
| {
|
| var breakpoints = [];
|
|
|