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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.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/JavaScriptSourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index 13b5de4e4fd21e80c5f72eb25df571108d69d02f..9096f1a683bcdd60e1839419f6681f2d1e2a1894 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -40,7 +40,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
this._scriptsPanel = Sources.SourcesPanel.instance();
this._breakpointManager = Bindings.breakpointManager;
- if (uiSourceCode.project().type() === Workspace.projectTypes.Debugger)
+ if (Bindings.DefaultScriptMapping.isDebuggerUISourceCode(uiSourceCode))
this.element.classList.add('source-frame-debugger-script');
this._popoverHelper = new Components.ObjectPopoverHelper(
@@ -80,7 +80,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
}
if (this._scriptFileForTarget.size || uiSourceCode.extension() === 'js' ||
- uiSourceCode.project().type() === Workspace.projectTypes.Snippets)
+ Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode))
this._compiler = new Sources.JavaScriptCompiler(this);
Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._showBlackboxInfobarIfNeeded, this);
@@ -103,7 +103,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
result.push(new UI.ToolbarText(Common.UIString('(source mapped from %s)', parsedURL.displayName)));
}
- if (this.uiSourceCode().project().type() === Workspace.projectTypes.Snippets) {
+ if (Snippets.ScriptSnippetModel.isSnippetUISourceCode(this.uiSourceCode())) {
result.push(new UI.ToolbarSeparator(true));
var runSnippet = UI.Toolbar.createActionButtonForId('debugger.run-snippet');
runSnippet.setText(Host.isMac() ? Common.UIString('\u2318+Enter') : Common.UIString('Ctrl+Enter'));
@@ -117,8 +117,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
var uiSourceCode = this.uiSourceCode();
if (!uiSourceCode.contentType().hasScripts())
return;
- var projectType = uiSourceCode.project().type();
- if (projectType === Workspace.projectTypes.Snippets)
+ if (Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode))
return;
if (!Bindings.blackboxManager.isBlackboxedUISourceCode(uiSourceCode)) {
this._hideBlackboxInfobar();
@@ -148,7 +147,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
function unblackbox() {
Bindings.blackboxManager.unblackboxUISourceCode(uiSourceCode);
- if (projectType === Workspace.projectTypes.ContentScripts)
+ if (Bindings.NetworkProject.isContentScriptUISourceCode(uiSourceCode))
Bindings.blackboxManager.unblackboxContentScripts();
}
@@ -274,7 +273,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
* @this {Sources.JavaScriptSourceFrame}
*/
function populateSourceMapMembers() {
- if (this.uiSourceCode().project().type() === Workspace.projectTypes.Network &&
+ if (Bindings.NetworkProject.isNetworkUISourceCode(this.uiSourceCode()) &&
Common.moduleSetting('jsSourceMapsEnabled').get() &&
!Bindings.blackboxManager.isBlackboxedUISourceCode(this.uiSourceCode())) {
if (this._scriptFileForTarget.size) {
@@ -330,7 +329,7 @@ Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame {
}
_supportsEnabledBreakpointsWhileEditing() {
- return this.uiSourceCode().project().type() === Workspace.projectTypes.Snippets;
+ return Snippets.ScriptSnippetModel.isSnippetUISourceCode(this.uiSourceCode());
}
_restoreBreakpointsIfConsistentScripts() {

Powered by Google App Engine
This is Rietveld 408576698