| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 /** | 119 /** |
| 120 * @return {boolean} | 120 * @return {boolean} |
| 121 */ | 121 */ |
| 122 _isEditorShowing: function() | 122 _isEditorShowing: function() |
| 123 { | 123 { |
| 124 return this.isShowing() && this._editorAttached; | 124 return this.isShowing() && this._editorAttached; |
| 125 }, | 125 }, |
| 126 | 126 |
| 127 willHide: function() | 127 willHide: function() |
| 128 { | 128 { |
| 129 WebInspector.View.prototype.willHide.call(this); | 129 WebInspector.Widget.prototype.willHide.call(this); |
| 130 | 130 |
| 131 this._clearPositionToReveal(); | 131 this._clearPositionToReveal(); |
| 132 }, | 132 }, |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * @return {!WebInspector.ToolbarText} | 135 * @return {!WebInspector.ToolbarText} |
| 136 */ | 136 */ |
| 137 toolbarText: function() | 137 toolbarText: function() |
| 138 { | 138 { |
| 139 return this._sourcePosition; | 139 return this._sourcePosition; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 340 } |
| 341 this.onTextEditorContentLoaded(); | 341 this.onTextEditorContentLoaded(); |
| 342 }, | 342 }, |
| 343 | 343 |
| 344 onTextEditorContentLoaded: function() {}, | 344 onTextEditorContentLoaded: function() {}, |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig | 347 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig |
| 348 * @param {boolean} shouldJump | 348 * @param {boolean} shouldJump |
| 349 * @param {boolean} jumpBackwards | 349 * @param {boolean} jumpBackwards |
| 350 * @param {function(!WebInspector.View, number)} searchFinishedCallback | 350 * @param {function(!WebInspector.Widget, number)} searchFinishedCallback |
| 351 */ | 351 */ |
| 352 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear
chFinishedCallback) | 352 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear
chFinishedCallback) |
| 353 { | 353 { |
| 354 this._currentSearchResultIndex = -1; | 354 this._currentSearchResultIndex = -1; |
| 355 this._searchResults = []; | 355 this._searchResults = []; |
| 356 | 356 |
| 357 var regex = searchConfig.toSearchRegex(); | 357 var regex = searchConfig.toSearchRegex(); |
| 358 this._searchRegex = regex; | 358 this._searchRegex = regex; |
| 359 this._searchResults = this._collectRegexMatches(regex); | 359 this._searchResults = this._collectRegexMatches(regex); |
| 360 searchFinishedCallback(this, this._searchResults.length); | 360 searchFinishedCallback(this, this._searchResults.length); |
| 361 if (!this._searchResults.length) | 361 if (!this._searchResults.length) |
| 362 this._textEditor.cancelSearchResultsHighlight(); | 362 this._textEditor.cancelSearchResultsHighlight(); |
| 363 else if (shouldJump && jumpBackwards) | 363 else if (shouldJump && jumpBackwards) |
| 364 this.jumpToPreviousSearchResult(); | 364 this.jumpToPreviousSearchResult(); |
| 365 else if (shouldJump) | 365 else if (shouldJump) |
| 366 this.jumpToNextSearchResult(); | 366 this.jumpToNextSearchResult(); |
| 367 else | 367 else |
| 368 this._textEditor.highlightSearchResults(regex, null); | 368 this._textEditor.highlightSearchResults(regex, null); |
| 369 }, | 369 }, |
| 370 | 370 |
| 371 /** | 371 /** |
| 372 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig | 372 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig |
| 373 * @param {boolean} shouldJump | 373 * @param {boolean} shouldJump |
| 374 * @param {boolean} jumpBackwards | 374 * @param {boolean} jumpBackwards |
| 375 * @param {function(!WebInspector.View, number)} searchFinishedCallback | 375 * @param {function(!WebInspector.Widget, number)} searchFinishedCallback |
| 376 * @param {function(number)} currentMatchChangedCallback | 376 * @param {function(number)} currentMatchChangedCallback |
| 377 * @param {function()} searchResultsChangedCallback | 377 * @param {function()} searchResultsChangedCallback |
| 378 */ | 378 */ |
| 379 performSearch: function(searchConfig, shouldJump, jumpBackwards, searchFinis
hedCallback, currentMatchChangedCallback, searchResultsChangedCallback) | 379 performSearch: function(searchConfig, shouldJump, jumpBackwards, searchFinis
hedCallback, currentMatchChangedCallback, searchResultsChangedCallback) |
| 380 { | 380 { |
| 381 this._resetSearch(); | 381 this._resetSearch(); |
| 382 this._currentSearchMatchChangedCallback = currentMatchChangedCallback; | 382 this._currentSearchMatchChangedCallback = currentMatchChangedCallback; |
| 383 this._searchResultsChangedCallback = searchResultsChangedCallback; | 383 this._searchResultsChangedCallback = searchResultsChangedCallback; |
| 384 var searchFunction = this._doFindSearchMatches.bind(this, searchConfig,
shouldJump, jumpBackwards, searchFinishedCallback); | 384 var searchFunction = this._doFindSearchMatches.bind(this, searchConfig,
shouldJump, jumpBackwards, searchFinishedCallback); |
| 385 if (this.loaded) | 385 if (this.loaded) |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 | 1041 |
| 1042 /** | 1042 /** |
| 1043 * @param {!WebInspector.SourceFrameMessage} a | 1043 * @param {!WebInspector.SourceFrameMessage} a |
| 1044 * @param {!WebInspector.SourceFrameMessage} b | 1044 * @param {!WebInspector.SourceFrameMessage} b |
| 1045 * @return {number} | 1045 * @return {number} |
| 1046 */ | 1046 */ |
| 1047 WebInspector.SourceFrameMessage.messageLevelComparator = function(a, b) | 1047 WebInspector.SourceFrameMessage.messageLevelComparator = function(a, b) |
| 1048 { | 1048 { |
| 1049 return WebInspector.SourceFrameMessage._messageLevelPriority[a.level()] - We
bInspector.SourceFrameMessage._messageLevelPriority[b.level()]; | 1049 return WebInspector.SourceFrameMessage._messageLevelPriority[a.level()] - We
bInspector.SourceFrameMessage._messageLevelPriority[b.level()]; |
| 1050 } | 1050 } |
| OLD | NEW |