| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 /** | 547 /** |
| 548 * @override | 548 * @override |
| 549 * @param {string} query | 549 * @param {string} query |
| 550 * @param {boolean} caseSensitive | 550 * @param {boolean} caseSensitive |
| 551 * @param {boolean} isRegex | 551 * @param {boolean} isRegex |
| 552 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback | 552 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback |
| 553 */ | 553 */ |
| 554 searchInContent: function(query, caseSensitive, isRegex, callback) | 554 searchInContent: function(query, caseSensitive, isRegex, callback) |
| 555 { | 555 { |
| 556 var content = this.content(); | 556 var content = this.content(); |
| 557 if (content) { | 557 if (!content) { |
| 558 WebInspector.StaticContentProvider.searchInContent(content, query, c
aseSensitive, isRegex, callback); | 558 this._project.searchInFileContent(this, query, caseSensitive, isRege
x, callback); |
| 559 return; | 559 return; |
| 560 } | 560 } |
| 561 | 561 |
| 562 this._project.searchInFileContent(this, query, caseSensitive, isRegex, c
allback); | 562 // searchInContent should call back later. |
| 563 setTimeout(doSearch.bind(null, content), 0); |
| 564 |
| 565 /** |
| 566 * @param {string} content |
| 567 */ |
| 568 function doSearch(content) |
| 569 { |
| 570 callback(WebInspector.ContentProvider.performSearchInContent(content
, query, caseSensitive, isRegex)); |
| 571 } |
| 563 }, | 572 }, |
| 564 | 573 |
| 565 /** | 574 /** |
| 566 * @param {?string} content | 575 * @param {?string} content |
| 567 */ | 576 */ |
| 568 _fireContentAvailable: function(content) | 577 _fireContentAvailable: function(content) |
| 569 { | 578 { |
| 570 this._contentLoaded = true; | 579 this._contentLoaded = true; |
| 571 this._content = content; | 580 this._content = content; |
| 572 | 581 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 }, | 975 }, |
| 967 | 976 |
| 968 /** | 977 /** |
| 969 * @return {*} | 978 * @return {*} |
| 970 */ | 979 */ |
| 971 data: function() | 980 data: function() |
| 972 { | 981 { |
| 973 return this._data; | 982 return this._data; |
| 974 } | 983 } |
| 975 } | 984 } |
| OLD | NEW |