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

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: 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 searchInDynamicScriptsAndExtensions = Common.moduleSetting('searchInDyna micScriptsAndExtensions').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()
86 * @param {!Workspace.Project} project 80 .filter(project => project.type() !== Workspace.projectTypes.Service)
dgozman 2017/02/22 20:17:06 I personally don't like chaining multiple calls do
lushnikov 2017/02/22 21:22:37 Done.
87 * @return {boolean} 81 .filter(project => searchInDynamicScriptsAndExtensions || !project.isSer viceProject())
88 */ 82 .filter(
89 function filterOutContentScriptsIfNeeded(project) { 83 project => searchInDynamicScriptsAndExtensions || project.type() !== Workspace.projectTypes.ContentScripts);
90 return Common.moduleSetting('searchInContentScripts').get() ||
91 project.type() !== Workspace.projectTypes.ContentScripts;
92 }
93
94 return Workspace.workspace.projects().filter(filterOutServiceProjects).filte r(filterOutContentScriptsIfNeeded);
95 } 84 }
96 85
97 /** 86 /**
98 * @override 87 * @override
99 * @param {!Workspace.ProjectSearchConfig} searchConfig 88 * @param {!Workspace.ProjectSearchConfig} searchConfig
100 * @param {!Common.Progress} progress 89 * @param {!Common.Progress} progress
101 * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback 90 * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback
102 * @param {function(boolean)} searchFinishedCallback 91 * @param {function(boolean)} searchFinishedCallback
103 */ 92 */
104 performSearch(searchConfig, progress, searchResultCallback, searchFinishedCall back) { 93 performSearch(searchConfig, progress, searchResultCallback, searchFinishedCall back) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 scheduleSearchInNextFileOrFinish.call(this); 265 scheduleSearchInNextFileOrFinish.call(this);
277 } 266 }
278 } 267 }
279 268
280 /** 269 /**
281 * @override 270 * @override
282 */ 271 */
283 stopSearch() { 272 stopSearch() {
284 ++this._searchId; 273 ++this._searchId;
285 } 274 }
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 }; 275 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698