| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @implements {UI.ContextFlavorListener} | 5 * @implements {UI.ContextFlavorListener} |
| 6 * @implements {UI.ToolbarItem.ItemsProvider} | 6 * @implements {UI.ToolbarItem.ItemsProvider} |
| 7 * @unrestricted | 7 * @unrestricted |
| 8 */ | 8 */ |
| 9 Sources.XHRBreakpointsSidebarPane = class extends Components.BreakpointsSidebarP
aneBase { | 9 Sources.XHRBreakpointsSidebarPane = class extends Components.BreakpointsSidebarP
aneBase { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 contextMenu.appendItem(Common.UIString.capitalize('Add ^breakpoint'), this._
addButtonClicked.bind(this)); | 33 contextMenu.appendItem(Common.UIString.capitalize('Add ^breakpoint'), this._
addButtonClicked.bind(this)); |
| 34 contextMenu.show(); | 34 contextMenu.show(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 _addButtonClicked() { | 37 _addButtonClicked() { |
| 38 UI.viewManager.showView('sources.xhrBreakpoints'); | 38 UI.viewManager.showView('sources.xhrBreakpoints'); |
| 39 | 39 |
| 40 var inputElementContainer = createElementWithClass('p', 'breakpoint-conditio
n'); | 40 var inputElementContainer = createElementWithClass('p', 'breakpoint-conditio
n'); |
| 41 inputElementContainer.textContent = Common.UIString('Break when URL contains
:'); | 41 inputElementContainer.textContent = Common.UIString('Break when URL contains
:'); |
| 42 | 42 |
| 43 var inputElement = inputElementContainer.createChild('span', 'editing'); | 43 var inputElement = inputElementContainer.createChild('span'); |
| 44 inputElement.id = 'breakpoint-condition-input'; | 44 inputElement.id = 'breakpoint-condition-input'; |
| 45 this.addListElement(inputElementContainer, /** @type {?Element} */ (this.lis
tElement.firstChild)); | 45 this.addListElement(inputElementContainer, /** @type {?Element} */ (this.lis
tElement.firstChild)); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * @param {boolean} accept | 48 * @param {boolean} accept |
| 49 * @param {!Element} e | 49 * @param {!Element} e |
| 50 * @param {string} text | 50 * @param {string} text |
| 51 * @this {Sources.XHRBreakpointsSidebarPane} | 51 * @this {Sources.XHRBreakpointsSidebarPane} |
| 52 */ | 52 */ |
| 53 function finishEditing(accept, e, text) { | 53 function finishEditing(accept, e, text) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 contextMenu.appendItem(removeAllTitle, removeAllBreakpoints.bind(this)); | 134 contextMenu.appendItem(removeAllTitle, removeAllBreakpoints.bind(this)); |
| 135 contextMenu.show(); | 135 contextMenu.show(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 _checkboxClicked(url, event) { | 138 _checkboxClicked(url, event) { |
| 139 SDK.domDebuggerManager.toggleXHRBreakpoint(url, event.target.checked); | 139 SDK.domDebuggerManager.toggleXHRBreakpoint(url, event.target.checked); |
| 140 } | 140 } |
| 141 | 141 |
| 142 _labelClicked(url) { | 142 _labelClicked(url) { |
| 143 var element = this._breakpointElements.get(url) || null; | 143 var element = this._breakpointElements.get(url) || null; |
| 144 var inputElement = createElementWithClass('span', 'breakpoint-condition edit
ing'); | 144 var inputElement = createElementWithClass('span', 'breakpoint-condition'); |
| 145 inputElement.textContent = url; | 145 inputElement.textContent = url; |
| 146 this.listElement.insertBefore(inputElement, element); | 146 this.listElement.insertBefore(inputElement, element); |
| 147 element.classList.add('hidden'); | 147 element.classList.add('hidden'); |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * @param {boolean} accept | 150 * @param {boolean} accept |
| 151 * @param {!Element} e | 151 * @param {!Element} e |
| 152 * @param {string} text | 152 * @param {string} text |
| 153 * @this {Sources.XHRBreakpointsSidebarPane} | 153 * @this {Sources.XHRBreakpointsSidebarPane} |
| 154 */ | 154 */ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 element.classList.add('breakpoint-hit'); | 194 element.classList.add('breakpoint-hit'); |
| 195 this._highlightedElement = element; | 195 this._highlightedElement = element; |
| 196 } | 196 } |
| 197 | 197 |
| 198 _restoreBreakpoints() { | 198 _restoreBreakpoints() { |
| 199 var breakpoints = SDK.domDebuggerManager.xhrBreakpoints(); | 199 var breakpoints = SDK.domDebuggerManager.xhrBreakpoints(); |
| 200 for (var url of breakpoints.keys()) | 200 for (var url of breakpoints.keys()) |
| 201 this._setBreakpoint(url, breakpoints.get(url)); | 201 this._setBreakpoint(url, breakpoints.get(url)); |
| 202 } | 202 } |
| 203 }; | 203 }; |
| OLD | NEW |