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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2536273003: [DevTools] Remove Workspace.projectTypes enum part1. (Closed)
Patch Set: Created 4 years, 1 month 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/SourcesPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
index cf933de55a06e1f0fdd09966b3a18b2ff02a80f4..33e33f3f9927e60b5af1b79290eea62c30c6be45 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -540,7 +540,7 @@ Sources.SourcesPanel = class extends UI.Panel {
*/
_runSnippet() {
var uiSourceCode = this._sourcesView.currentUISourceCode();
- if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets)
+ if (!uiSourceCode || !Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode))
return false;
var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext);
@@ -789,7 +789,7 @@ Sources.SourcesPanel = class extends UI.Panel {
if (Runtime.experiments.isEnabled('persistence2'))
return;
- if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) {
+ if (Persistence.FileSystemWorkspaceBinding.isFileSystemUISourceCode(uiSourceCode)) {
var binding = Persistence.persistence.binding(uiSourceCode);
if (!binding) {
contextMenu.appendItem(
@@ -802,16 +802,8 @@ Sources.SourcesPanel = class extends UI.Panel {
}
}
- /**
- * @param {!Workspace.Project} project
- */
- function filterProject(project) {
- return project.type() === Workspace.projectTypes.FileSystem;
- }
-
- if (uiSourceCode.project().type() === Workspace.projectTypes.Network ||
- uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts) {
- if (!this._workspace.projects().filter(filterProject).length)
+ if (Bindings.NetworkProject.isNetworkUISourceCode(uiSourceCode)) {
+ if (!Persistence.FileSystemWorkspaceBinding.uiSourceCodes(this._workspace).length)
return;
if (this._workspace.uiSourceCodeForURL(uiSourceCode.url()) === uiSourceCode) {
contextMenu.appendItem(
@@ -840,7 +832,7 @@ Sources.SourcesPanel = class extends UI.Panel {
contextMenu.appendSeparator();
}
this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
- if (projectType !== Workspace.projectTypes.FileSystem) {
+ if (!uiSourceCode.project().canSetFileContent()) {
contextMenu.appendItem(
Common.UIString.capitalize('Local ^modifications\u2026'), this._showLocalHistory.bind(this, uiSourceCode));
}
@@ -876,10 +868,8 @@ Sources.SourcesPanel = class extends UI.Panel {
contextMenu.appendItem(
Common.UIString.capitalize('Continue to ^here'), this._continueToLocation.bind(this, uiLocation));
}
- }
-
- if (contentType.hasScripts() && projectType !== Workspace.projectTypes.Snippets)
this._callstackPane.appendBlackboxURLContextMenuItems(contextMenu, uiSourceCode);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698