Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js

Issue 2692923013: DevTools: do not search in anonymous scripts unless specifically asked for. (Closed)
Patch Set: address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 var project = projects[i]; 67 var project = projects[i];
68 var projectProgress = compositeProgress.createSubProgress(project.uiSource Codes().length); 68 var projectProgress = compositeProgress.createSubProgress(project.uiSource Codes().length);
69 project.indexContent(projectProgress); 69 project.indexContent(projectProgress);
70 } 70 }
71 } 71 }
72 72
73 /** 73 /**
74 * @return {!Array.<!Workspace.Project>} 74 * @return {!Array.<!Workspace.Project>}
75 */ 75 */
76 _projects() { 76 _projects() {
77 /** 77 var searchInAnonymousAndContentScripts = Common.moduleSetting('searchInAnony mousAndContentScripts').get();
78 * @param {!Workspace.Project} project
79 * @return {boolean}
80 */
81 function filterOutServiceProjects(project) {
82 return project.type() !== Workspace.projectTypes.Service;
83 }
84 78
85 /** 79 return Workspace.workspace.projects().filter(project => {
86 * @param {!Workspace.Project} project 80 if (project.type() === Workspace.projectTypes.Service)
87 * @return {boolean} 81 return false;
88 */ 82 if (!searchInAnonymousAndContentScripts && project.isServiceProject())
89 function filterOutContentScriptsIfNeeded(project) { 83 return false;
90 return Common.moduleSetting('searchInContentScripts').get() || 84 if (!searchInAnonymousAndContentScripts && project.type() === Workspace.pr ojectTypes.ContentScripts)
91 project.type() !== Workspace.projectTypes.ContentScripts; 85 return false;
92 } 86 return true;
93 87 });
94 return Workspace.workspace.projects().filter(filterOutServiceProjects).filte r(filterOutContentScriptsIfNeeded);
95 } 88 }
96 89
97 /** 90 /**
98 * @override 91 * @override
99 * @param {!Workspace.ProjectSearchConfig} searchConfig 92 * @param {!Workspace.ProjectSearchConfig} searchConfig
100 * @param {!Common.Progress} progress 93 * @param {!Common.Progress} progress
101 * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback 94 * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback
102 * @param {function(boolean)} searchFinishedCallback 95 * @param {function(boolean)} searchFinishedCallback
103 */ 96 */
104 performSearch(searchConfig, progress, searchResultCallback, searchFinishedCall back) { 97 performSearch(searchConfig, progress, searchResultCallback, searchFinishedCall back) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 scheduleSearchInNextFileOrFinish.call(this); 269 scheduleSearchInNextFileOrFinish.call(this);
277 } 270 }
278 } 271 }
279 272
280 /** 273 /**
281 * @override 274 * @override
282 */ 275 */
283 stopSearch() { 276 stopSearch() {
284 ++this._searchId; 277 ++this._searchId;
285 } 278 }
286
287 /**
288 * @override
289 * @param {!Workspace.ProjectSearchConfig} searchConfig
290 * @return {!Sources.FileBasedSearchResultsPane}
291 */
292 createSearchResultsPane(searchConfig) {
293 return new Sources.FileBasedSearchResultsPane(searchConfig);
294 }
295 }; 279 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698