| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.SidebarPane} | 7 * @extends {WebInspector.SidebarPane} |
| 8 * @param {!WebInspector.BreakpointManager} breakpointManager | 8 * @param {!WebInspector.BreakpointManager} breakpointManager |
| 9 * @param {function(!WebInspector.UISourceCode, number=, number=, boolean=)} sho
wSourceLineDelegate | 9 * @param {function(!WebInspector.UISourceCode, number=, number=, boolean=)} sho
wSourceLineDelegate |
| 10 */ | 10 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 /** | 68 /** |
| 69 * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint | 69 * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint |
| 70 * @param {!WebInspector.UILocation} uiLocation | 70 * @param {!WebInspector.UILocation} uiLocation |
| 71 */ | 71 */ |
| 72 _addBreakpoint: function(breakpoint, uiLocation) | 72 _addBreakpoint: function(breakpoint, uiLocation) |
| 73 { | 73 { |
| 74 var element = createElementWithClass("li", "cursor-pointer"); | 74 var element = createElementWithClass("li", "cursor-pointer"); |
| 75 element.addEventListener("contextmenu", this._breakpointContextMenu.bind
(this, breakpoint), true); | 75 element.addEventListener("contextmenu", this._breakpointContextMenu.bind
(this, breakpoint), true); |
| 76 element.addEventListener("click", this._breakpointClicked.bind(this, uiL
ocation), false); | 76 element.addEventListener("click", this._breakpointClicked.bind(this, uiL
ocation), false); |
| 77 | 77 |
| 78 var checkbox = createCheckboxLabel(uiLocation.linkText(), breakpoint.ena
bled()); | 78 var checkboxLabel = createCheckboxLabel(uiLocation.linkText(), breakpoin
t.enabled()); |
| 79 element.appendChild(checkbox); | 79 element.appendChild(checkboxLabel); |
| 80 checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(
this, breakpoint), false); | 80 checkboxLabel.addEventListener("click", this._breakpointCheckboxClicked.
bind(this, breakpoint), false); |
| 81 | 81 |
| 82 var snippetElement = element.createChild("div", "source-text monospace")
; | 82 var snippetElement = element.createChild("div", "source-text monospace")
; |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * @param {?string} content | 85 * @param {?string} content |
| 86 */ | 86 */ |
| 87 function didRequestContent(content) | 87 function didRequestContent(content) |
| 88 { | 88 { |
| 89 var lineNumber = uiLocation.lineNumber | 89 var lineNumber = uiLocation.lineNumber |
| 90 var columnNumber = uiLocation.columnNumber; | 90 var columnNumber = uiLocation.columnNumber; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 101 | 101 |
| 102 element._data = uiLocation; | 102 element._data = uiLocation; |
| 103 var currentElement = this.listElement.firstChild; | 103 var currentElement = this.listElement.firstChild; |
| 104 while (currentElement) { | 104 while (currentElement) { |
| 105 if (currentElement._data && this._compareBreakpoints(currentElement.
_data, element._data) > 0) | 105 if (currentElement._data && this._compareBreakpoints(currentElement.
_data, element._data) > 0) |
| 106 break; | 106 break; |
| 107 currentElement = currentElement.nextSibling; | 107 currentElement = currentElement.nextSibling; |
| 108 } | 108 } |
| 109 this._addListElement(element, currentElement); | 109 this._addListElement(element, currentElement); |
| 110 | 110 |
| 111 var breakpointItem = { element: element, checkbox: checkbox }; | 111 var breakpointItem = { element: element, checkbox: checkboxLabel.checkbo
xElement }; |
| 112 this._items.set(breakpoint, breakpointItem); | 112 this._items.set(breakpoint, breakpointItem); |
| 113 | 113 |
| 114 this.expand(); | 114 this.expand(); |
| 115 }, | 115 }, |
| 116 | 116 |
| 117 /** | 117 /** |
| 118 * @param {!WebInspector.Event} event | 118 * @param {!WebInspector.Event} event |
| 119 */ | 119 */ |
| 120 _breakpointRemoved: function(event) | 120 _breakpointRemoved: function(event) |
| 121 { | 121 { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 this.listElement.removeChildren(); | 242 this.listElement.removeChildren(); |
| 243 if (this.listElement.parentElement) { | 243 if (this.listElement.parentElement) { |
| 244 this.element.removeChild(this.listElement); | 244 this.element.removeChild(this.listElement); |
| 245 this.element.appendChild(this.emptyElement); | 245 this.element.appendChild(this.emptyElement); |
| 246 } | 246 } |
| 247 this._items.clear(); | 247 this._items.clear(); |
| 248 }, | 248 }, |
| 249 | 249 |
| 250 __proto__: WebInspector.SidebarPane.prototype | 250 __proto__: WebInspector.SidebarPane.prototype |
| 251 } | 251 } |
| OLD | NEW |