OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 * @param {function(!WebInspector.View, number)} searchFinishedCallback | 417 * @param {function(!WebInspector.View, number)} searchFinishedCallback |
418 */ | 418 */ |
419 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear
chFinishedCallback) | 419 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear
chFinishedCallback) |
420 { | 420 { |
421 this._currentSearchResultIndex = -1; | 421 this._currentSearchResultIndex = -1; |
422 this._searchResults = []; | 422 this._searchResults = []; |
423 | 423 |
424 var regex = WebInspector.SourceFrame._createSearchRegexForConfig(searchC
onfig); | 424 var regex = WebInspector.SourceFrame._createSearchRegexForConfig(searchC
onfig); |
425 this._searchRegex = regex; | 425 this._searchRegex = regex; |
426 this._searchResults = this._collectRegexMatches(regex); | 426 this._searchResults = this._collectRegexMatches(regex); |
| 427 searchFinishedCallback(this, this._searchResults.length); |
427 if (!this._searchResults.length) | 428 if (!this._searchResults.length) |
428 this._textEditor.cancelSearchResultsHighlight(); | 429 this._textEditor.cancelSearchResultsHighlight(); |
429 else if (shouldJump && jumpBackwards) | 430 else if (shouldJump && jumpBackwards) |
430 this.jumpToPreviousSearchResult(); | 431 this.jumpToPreviousSearchResult(); |
431 else if (shouldJump) | 432 else if (shouldJump) |
432 this.jumpToNextSearchResult(); | 433 this.jumpToNextSearchResult(); |
433 else | 434 else |
434 this._textEditor.highlightSearchResults(regex, null); | 435 this._textEditor.highlightSearchResults(regex, null); |
435 searchFinishedCallback(this, this._searchResults.length); | |
436 }, | 436 }, |
437 | 437 |
438 /** | 438 /** |
439 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig | 439 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig |
440 * @param {boolean} shouldJump | 440 * @param {boolean} shouldJump |
441 * @param {boolean} jumpBackwards | 441 * @param {boolean} jumpBackwards |
442 * @param {function(!WebInspector.View, number)} searchFinishedCallback | 442 * @param {function(!WebInspector.View, number)} searchFinishedCallback |
443 * @param {function(number)} currentMatchChangedCallback | 443 * @param {function(number)} currentMatchChangedCallback |
444 * @param {function()} searchResultsChangedCallback | 444 * @param {function()} searchResultsChangedCallback |
445 */ | 445 */ |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1008 |
1009 /** | 1009 /** |
1010 * @param {?WebInspector.TextRange} from | 1010 * @param {?WebInspector.TextRange} from |
1011 * @param {?WebInspector.TextRange} to | 1011 * @param {?WebInspector.TextRange} to |
1012 */ | 1012 */ |
1013 onJumpToPosition: function(from, to) | 1013 onJumpToPosition: function(from, to) |
1014 { | 1014 { |
1015 this._sourceFrame.onJumpToPosition(from, to); | 1015 this._sourceFrame.onJumpToPosition(from, to); |
1016 } | 1016 } |
1017 } | 1017 } |
OLD | NEW |