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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.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/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..8ac011af6280bb0dffcee12ed2e65cd21c7de2e1 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)
return false;
var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext);
@@ -831,16 +831,14 @@ Sources.SourcesPanel = class extends UI.Panel {
return;
var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (target);
- var projectType = uiSourceCode.project().type();
-
- if (projectType !== Workspace.projectTypes.Debugger &&
+ if (!uiSourceCode.isFromServiceProject() &&
!event.target.isSelfOrDescendant(this._navigatorTabbedLocation.widget().element)) {
contextMenu.appendItem(
Common.UIString.capitalize('Reveal in ^navigator'), this._handleContextMenuReveal.bind(this, uiSourceCode));
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 +874,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