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 * @unrestricted | 6 * @unrestricted |
7 */ | 7 */ |
8 Sources.JavaScriptBreakpointsSidebarPane = class extends UI.ThrottledWidget { | 8 Sources.JavaScriptBreakpointsSidebarPane = class extends UI.ThrottledWidget { |
9 constructor() { | 9 constructor() { |
10 super(true); | 10 super(true); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 var snippetElement = element[Sources.JavaScriptBreakpointsSidebarPane._snipp
etElementSymbol]; | 118 var snippetElement = element[Sources.JavaScriptBreakpointsSidebarPane._snipp
etElementSymbol]; |
119 return uiLocation.uiSourceCode.requestContent().then(fillSnippetElement.bind
(null, snippetElement)); | 119 return uiLocation.uiSourceCode.requestContent().then(fillSnippetElement.bind
(null, snippetElement)); |
120 | 120 |
121 /** | 121 /** |
122 * @param {!Element} snippetElement | 122 * @param {!Element} snippetElement |
123 * @param {?string} content | 123 * @param {?string} content |
124 */ | 124 */ |
125 function fillSnippetElement(snippetElement, content) { | 125 function fillSnippetElement(snippetElement, content) { |
126 var lineNumber = uiLocation.lineNumber; | 126 var lineNumber = uiLocation.lineNumber; |
127 var text = new Common.Text(content || ''); | 127 var text = new TextUtils.Text(content || ''); |
128 if (lineNumber < text.lineCount()) { | 128 if (lineNumber < text.lineCount()) { |
129 var lineText = text.lineAt(lineNumber); | 129 var lineText = text.lineAt(lineNumber); |
130 var maxSnippetLength = 200; | 130 var maxSnippetLength = 200; |
131 snippetElement.textContent = lineText.trimEnd(maxSnippetLength); | 131 snippetElement.textContent = lineText.trimEnd(maxSnippetLength); |
132 } | 132 } |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 /** | 136 /** |
137 * @param {!Event} event | 137 * @param {!Event} event |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 this.update(); | 219 this.update(); |
220 } | 220 } |
221 | 221 |
222 _didUpdateForTest() { | 222 _didUpdateForTest() { |
223 } | 223 } |
224 }; | 224 }; |
225 | 225 |
226 Sources.JavaScriptBreakpointsSidebarPane._locationSymbol = Symbol('location'); | 226 Sources.JavaScriptBreakpointsSidebarPane._locationSymbol = Symbol('location'); |
227 Sources.JavaScriptBreakpointsSidebarPane._checkboxLabelSymbol = Symbol('checkbox
-label'); | 227 Sources.JavaScriptBreakpointsSidebarPane._checkboxLabelSymbol = Symbol('checkbox
-label'); |
228 Sources.JavaScriptBreakpointsSidebarPane._snippetElementSymbol = Symbol('snippet
-element'); | 228 Sources.JavaScriptBreakpointsSidebarPane._snippetElementSymbol = Symbol('snippet
-element'); |
OLD | NEW |