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

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

Issue 2546473005: [DevTools] Remove unnecessary checks for project types. (Closed)
Patch Set: fixed comment Created 4 years 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/ScriptFormatterEditorAction.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
index 3e9b88f9bc2f26202a1e45d3d4154bffdb26c689..80d29525dc2ec06ff1fc3f4020ee540107730538 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
@@ -206,11 +206,11 @@ Sources.ScriptFormatterEditorAction = class {
_isFormatableScript(uiSourceCode) {
if (!uiSourceCode)
return false;
- if (Persistence.persistence.binding(uiSourceCode))
+ if (uiSourceCode.project().canSetFileContent())
+ return false;
+ if (uiSourceCode.project().type() === Workspace.projectTypes.Formatter)
return false;
- var supportedProjectTypes =
- [Workspace.projectTypes.Network, Workspace.projectTypes.Debugger, Workspace.projectTypes.ContentScripts];
- if (supportedProjectTypes.indexOf(uiSourceCode.project().type()) === -1)
+ if (Persistence.persistence.binding(uiSourceCode))
return false;
return uiSourceCode.contentType().hasScripts();
}

Powered by Google App Engine
This is Rietveld 408576698