| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 * @unrestricted | 6 * @unrestricted |
| 7 * @implements {UI.Searchable} | 7 * @implements {UI.Searchable} |
| 8 */ | 8 */ |
| 9 Timeline.TimelineTreeView = class extends UI.VBox { | 9 Timeline.TimelineTreeView = class extends UI.VBox { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 * @override | 376 * @override |
| 377 * @param {!UI.SearchableView.SearchConfig} searchConfig | 377 * @param {!UI.SearchableView.SearchConfig} searchConfig |
| 378 * @param {boolean} shouldJump | 378 * @param {boolean} shouldJump |
| 379 * @param {boolean=} jumpBackwards | 379 * @param {boolean=} jumpBackwards |
| 380 */ | 380 */ |
| 381 performSearch(searchConfig, shouldJump, jumpBackwards) { | 381 performSearch(searchConfig, shouldJump, jumpBackwards) { |
| 382 this._searchResults = []; | 382 this._searchResults = []; |
| 383 this._currentResult = 0; | 383 this._currentResult = 0; |
| 384 if (!this._root) | 384 if (!this._root) |
| 385 return; | 385 return; |
| 386 var searchRegex = createPlainTextSearchRegex(searchConfig.query, 'i'); | 386 var searchRegex = searchConfig.toSearchRegex(); |
| 387 this._searchResults = | 387 this._searchResults = |
| 388 this._root.searchTree(event => Timeline.TimelineUIUtils.testContentMatch
ing(event, searchRegex)); | 388 this._root.searchTree(event => Timeline.TimelineUIUtils.testContentMatch
ing(event, searchRegex)); |
| 389 this._searchableView.updateSearchMatchesCount(this._searchResults.length); | 389 this._searchableView.updateSearchMatchesCount(this._searchResults.length); |
| 390 } | 390 } |
| 391 | 391 |
| 392 /** | 392 /** |
| 393 * @override | 393 * @override |
| 394 */ | 394 */ |
| 395 jumpToNextSearchResult() { | 395 jumpToNextSearchResult() { |
| 396 if (!this._searchResults.length) | 396 if (!this._searchResults.length) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 407 return; | 407 return; |
| 408 this.selectProfileNode(this._searchResults[this._currentResult], false); | 408 this.selectProfileNode(this._searchResults[this._currentResult], false); |
| 409 this._currentResult = mod(this._currentResult - 1, this._searchResults.lengt
h); | 409 this._currentResult = mod(this._currentResult - 1, this._searchResults.lengt
h); |
| 410 } | 410 } |
| 411 | 411 |
| 412 /** | 412 /** |
| 413 * @override | 413 * @override |
| 414 * @return {boolean} | 414 * @return {boolean} |
| 415 */ | 415 */ |
| 416 supportsCaseSensitiveSearch() { | 416 supportsCaseSensitiveSearch() { |
| 417 return false; | 417 return true; |
| 418 } | 418 } |
| 419 | 419 |
| 420 /** | 420 /** |
| 421 * @override | 421 * @override |
| 422 * @return {boolean} | 422 * @return {boolean} |
| 423 */ | 423 */ |
| 424 supportsRegexSearch() { | 424 supportsRegexSearch() { |
| 425 return false; | 425 return true; |
| 426 } | 426 } |
| 427 }; | 427 }; |
| 428 | 428 |
| 429 /** | 429 /** |
| 430 * @unrestricted | 430 * @unrestricted |
| 431 */ | 431 */ |
| 432 Timeline.TimelineTreeView.GridNode = class extends DataGrid.SortableDataGridNode
{ | 432 Timeline.TimelineTreeView.GridNode = class extends DataGrid.SortableDataGridNode
{ |
| 433 /** | 433 /** |
| 434 * @param {!TimelineModel.TimelineProfileTree.Node} profileNode | 434 * @param {!TimelineModel.TimelineProfileTree.Node} profileNode |
| 435 * @param {number} grandTotalTime | 435 * @param {number} grandTotalTime |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 | 940 |
| 941 _onSelectionChanged() { | 941 _onSelectionChanged() { |
| 942 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha
nged); | 942 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha
nged); |
| 943 } | 943 } |
| 944 }; | 944 }; |
| 945 | 945 |
| 946 /** @enum {symbol} */ | 946 /** @enum {symbol} */ |
| 947 Timeline.TimelineStackView.Events = { | 947 Timeline.TimelineStackView.Events = { |
| 948 SelectionChanged: Symbol('SelectionChanged') | 948 SelectionChanged: Symbol('SelectionChanged') |
| 949 }; | 949 }; |
| OLD | NEW |