| 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @constructor | 30 * @constructor |
| 31 * @implements {WebInspector.SearchScope} | 31 * @implements {WebInspector.SearchScope} |
| 32 * @param {WebInspector.Workspace} workspace | 32 * @param {WebInspector.Workspace} workspace |
| 33 */ | 33 */ |
| 34 WebInspector.ScriptsSearchScope = function(workspace) | 34 WebInspector.SourcesSearchScope = function(workspace) |
| 35 { | 35 { |
| 36 // FIXME: Add title once it is used by search controller. | 36 // FIXME: Add title once it is used by search controller. |
| 37 WebInspector.SearchScope.call(this) | 37 WebInspector.SearchScope.call(this) |
| 38 this._searchId = 0; | 38 this._searchId = 0; |
| 39 this._workspace = workspace; | 39 this._workspace = workspace; |
| 40 } | 40 } |
| 41 | 41 |
| 42 WebInspector.ScriptsSearchScope.prototype = { | 42 WebInspector.SourcesSearchScope.prototype = { |
| 43 /** | 43 /** |
| 44 * @param {WebInspector.Progress} progress | 44 * @param {WebInspector.Progress} progress |
| 45 * @param {function(boolean)} indexingFinishedCallback | 45 * @param {function(boolean)} indexingFinishedCallback |
| 46 */ | 46 */ |
| 47 performIndexing: function(progress, indexingFinishedCallback) | 47 performIndexing: function(progress, indexingFinishedCallback) |
| 48 { | 48 { |
| 49 this.stopSearch(); | 49 this.stopSearch(); |
| 50 | 50 |
| 51 function filterOutServiceProjects(project) | 51 function filterOutServiceProjects(project) |
| 52 { | 52 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 81 { | 81 { |
| 82 this.stopSearch(); | 82 this.stopSearch(); |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * @param {WebInspector.Project} project | 85 * @param {WebInspector.Project} project |
| 86 */ | 86 */ |
| 87 function filterOutServiceProjects(project) | 87 function filterOutServiceProjects(project) |
| 88 { | 88 { |
| 89 return !project.isServiceProject(); | 89 return !project.isServiceProject(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 var projects = this._workspace.projects().filter(filterOutServiceProject
s); | 92 var projects = this._workspace.projects().filter(filterOutServiceProject
s); |
| 93 var barrier = new CallbackBarrier(); | 93 var barrier = new CallbackBarrier(); |
| 94 var compositeProgress = new WebInspector.CompositeProgress(progress); | 94 var compositeProgress = new WebInspector.CompositeProgress(progress); |
| 95 for (var i = 0; i < projects.length; ++i) { | 95 for (var i = 0; i < projects.length; ++i) { |
| 96 var project = projects[i]; | 96 var project = projects[i]; |
| 97 var projectProgress = compositeProgress.createSubProgress(project.ui
SourceCodes().length); | 97 var projectProgress = compositeProgress.createSubProgress(project.ui
SourceCodes().length); |
| 98 var callback = barrier.createCallback(searchCallbackWrapper.bind(thi
s, this._searchId, project)); | 98 var callback = barrier.createCallback(searchCallbackWrapper.bind(thi
s, this._searchId, project)); |
| 99 project.searchInContent(searchConfig.query, !searchConfig.ignoreCase
, searchConfig.isRegex, projectProgress, callback); | 99 project.searchInContent(searchConfig.query, !searchConfig.ignoreCase
, searchConfig.isRegex, projectProgress, callback); |
| 100 } | 100 } |
| 101 barrier.callWhenDone(searchFinishedCallback.bind(this, true)); | 101 barrier.callWhenDone(searchFinishedCallback.bind(this, true)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 128 /** | 128 /** |
| 129 * @param {WebInspector.SearchConfig} searchConfig | 129 * @param {WebInspector.SearchConfig} searchConfig |
| 130 */ | 130 */ |
| 131 createSearchResultsPane: function(searchConfig) | 131 createSearchResultsPane: function(searchConfig) |
| 132 { | 132 { |
| 133 return new WebInspector.FileBasedSearchResultsPane(searchConfig); | 133 return new WebInspector.FileBasedSearchResultsPane(searchConfig); |
| 134 }, | 134 }, |
| 135 | 135 |
| 136 __proto__: WebInspector.SearchScope.prototype | 136 __proto__: WebInspector.SearchScope.prototype |
| 137 } | 137 } |
| OLD | NEW |