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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
index 641d357201eb8f158d168a1d85edd6c3b9882829..42ea08e3896209d330ff338554c1ea3fdfbb5ba4 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
@@ -74,24 +74,17 @@ Sources.SourcesSearchScope = class {
* @return {!Array.<!Workspace.Project>}
*/
_projects() {
- /**
- * @param {!Workspace.Project} project
- * @return {boolean}
- */
- function filterOutServiceProjects(project) {
- return project.type() !== Workspace.projectTypes.Service;
- }
-
- /**
- * @param {!Workspace.Project} project
- * @return {boolean}
- */
- function filterOutContentScriptsIfNeeded(project) {
- return Common.moduleSetting('searchInContentScripts').get() ||
- project.type() !== Workspace.projectTypes.ContentScripts;
- }
+ var searchInAnonymousAndContentScripts = Common.moduleSetting('searchInAnonymousAndContentScripts').get();
- return Workspace.workspace.projects().filter(filterOutServiceProjects).filter(filterOutContentScriptsIfNeeded);
+ return Workspace.workspace.projects().filter(project => {
+ if (project.type() === Workspace.projectTypes.Service)
+ return false;
+ if (!searchInAnonymousAndContentScripts && project.isServiceProject())
+ return false;
+ if (!searchInAnonymousAndContentScripts && project.type() === Workspace.projectTypes.ContentScripts)
+ return false;
+ return true;
+ });
}
/**
@@ -283,13 +276,4 @@ Sources.SourcesSearchScope = class {
stopSearch() {
++this._searchId;
}
-
- /**
- * @override
- * @param {!Workspace.ProjectSearchConfig} searchConfig
- * @return {!Sources.FileBasedSearchResultsPane}
- */
- createSearchResultsPane(searchConfig) {
- return new Sources.FileBasedSearchResultsPane(searchConfig);
- }
};

Powered by Google App Engine
This is Rietveld 408576698