OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Sources.FileBasedSearchResultsPane = class extends Sources.SearchResultsPane { | 7 Sources.FileBasedSearchResultsPane = class extends Sources.SearchResultsPane { |
8 /** | 8 /** |
9 * @param {!Workspace.ProjectSearchConfig} searchConfig | 9 * @param {!Workspace.ProjectSearchConfig} searchConfig |
10 */ | 10 */ |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 * @param {number} lineNumber | 173 * @param {number} lineNumber |
174 * @param {number} columnNumber | 174 * @param {number} columnNumber |
175 * @return {!Element} | 175 * @return {!Element} |
176 */ | 176 */ |
177 _createAnchor(uiSourceCode, lineNumber, columnNumber) { | 177 _createAnchor(uiSourceCode, lineNumber, columnNumber) { |
178 return Components.Linkifier.linkifyRevealable(uiSourceCode.uiLocation(lineNu
mber, columnNumber), ''); | 178 return Components.Linkifier.linkifyRevealable(uiSourceCode.uiLocation(lineNu
mber, columnNumber), ''); |
179 } | 179 } |
180 | 180 |
181 /** | 181 /** |
182 * @param {string} lineContent | 182 * @param {string} lineContent |
183 * @param {!Array.<!Common.SourceRange>} matchRanges | 183 * @param {!Array.<!TextUtils.SourceRange>} matchRanges |
184 */ | 184 */ |
185 _createContentSpan(lineContent, matchRanges) { | 185 _createContentSpan(lineContent, matchRanges) { |
186 var contentSpan = createElement('span'); | 186 var contentSpan = createElement('span'); |
187 contentSpan.className = 'search-match-content'; | 187 contentSpan.className = 'search-match-content'; |
188 contentSpan.textContent = lineContent; | 188 contentSpan.textContent = lineContent; |
189 UI.highlightRangesWithStyleClass(contentSpan, matchRanges, 'highlighted-matc
h'); | 189 UI.highlightRangesWithStyleClass(contentSpan, matchRanges, 'highlighted-matc
h'); |
190 return contentSpan; | 190 return contentSpan; |
191 } | 191 } |
192 | 192 |
193 /** | 193 /** |
194 * @param {string} lineContent | 194 * @param {string} lineContent |
195 * @param {!RegExp} regex | 195 * @param {!RegExp} regex |
196 * @return {!Array.<!Common.SourceRange>} | 196 * @return {!Array.<!TextUtils.SourceRange>} |
197 */ | 197 */ |
198 _regexMatchRanges(lineContent, regex) { | 198 _regexMatchRanges(lineContent, regex) { |
199 regex.lastIndex = 0; | 199 regex.lastIndex = 0; |
200 var match; | 200 var match; |
201 var matchRanges = []; | 201 var matchRanges = []; |
202 while ((regex.lastIndex < lineContent.length) && (match = regex.exec(lineCon
tent))) | 202 while ((regex.lastIndex < lineContent.length) && (match = regex.exec(lineCon
tent))) |
203 matchRanges.push(new Common.SourceRange(match.index, match[0].length)); | 203 matchRanges.push(new TextUtils.SourceRange(match.index, match[0].length)); |
204 | 204 |
205 return matchRanges; | 205 return matchRanges; |
206 } | 206 } |
207 | 207 |
208 /** | 208 /** |
209 * @param {number} startMatchIndex | 209 * @param {number} startMatchIndex |
210 * @return {boolean} | 210 * @return {boolean} |
211 */ | 211 */ |
212 _showMoreMatchesElementSelected(startMatchIndex) { | 212 _showMoreMatchesElementSelected(startMatchIndex) { |
213 this.removeChild(this._showMoreMatchesTreeElement); | 213 this.removeChild(this._showMoreMatchesTreeElement); |
214 this._appendSearchMatches(startMatchIndex, this._searchResult.searchMatches.
length); | 214 this._appendSearchMatches(startMatchIndex, this._searchResult.searchMatches.
length); |
215 return false; | 215 return false; |
216 } | 216 } |
217 }; | 217 }; |
OLD | NEW |