| Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
|
| index 0e52b82ad483e1ed48037b54e28e8dc4eb42511c..ccb50209afd0599dd61c04e0de190c0401c9ad8a 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
|
| @@ -43,8 +43,8 @@ Sources.SourcesNavigatorView = class extends Sources.NavigatorView {
|
| accept(uiSourceCode) {
|
| if (!super.accept(uiSourceCode))
|
| return false;
|
| - return uiSourceCode.project().type() !== Workspace.projectTypes.ContentScripts &&
|
| - uiSourceCode.project().type() !== Workspace.projectTypes.Snippets;
|
| + return !Bindings.NetworkProject.isContentScriptUISourceCode(uiSourceCode) &&
|
| + !Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode);
|
| }
|
|
|
| /**
|
| @@ -103,7 +103,8 @@ Sources.NetworkNavigatorView = class extends Sources.NavigatorView {
|
| * @return {boolean}
|
| */
|
| accept(uiSourceCode) {
|
| - return uiSourceCode.project().type() === Workspace.projectTypes.Network;
|
| + return Bindings.NetworkProject.isNetworkUISourceCode(uiSourceCode) &&
|
| + !Bindings.NetworkProject.isContentScriptUISourceCode(uiSourceCode);
|
| }
|
|
|
| /**
|
| @@ -157,7 +158,7 @@ Sources.FilesNavigatorView = class extends Sources.NavigatorView {
|
| * @return {boolean}
|
| */
|
| accept(uiSourceCode) {
|
| - return uiSourceCode.project().type() === Workspace.projectTypes.FileSystem;
|
| + return Persistence.FileSystemWorkspaceBinding.isFileSystemUISourceCode(uiSourceCode);
|
| }
|
|
|
| /**
|
| @@ -185,7 +186,7 @@ Sources.ContentScriptsNavigatorView = class extends Sources.NavigatorView {
|
| * @return {boolean}
|
| */
|
| accept(uiSourceCode) {
|
| - return uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts;
|
| + return Bindings.NetworkProject.isContentScriptUISourceCode(uiSourceCode);
|
| }
|
| };
|
|
|
| @@ -208,7 +209,7 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
|
| * @return {boolean}
|
| */
|
| accept(uiSourceCode) {
|
| - return uiSourceCode.project().type() === Workspace.projectTypes.Snippets;
|
| + return Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode);
|
| }
|
|
|
| /**
|
| @@ -243,7 +244,7 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
|
| */
|
| _handleEvaluateSnippet(uiSourceCode) {
|
| var executionContext = UI.context.flavor(SDK.ExecutionContext);
|
| - if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets || !executionContext)
|
| + if (!Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode) || !executionContext)
|
| return;
|
| Snippets.scriptSnippetModel.evaluateScriptSnippet(executionContext, uiSourceCode);
|
| }
|
| @@ -252,7 +253,7 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
|
| * @param {!Workspace.UISourceCode} uiSourceCode
|
| */
|
| _handleSaveAs(uiSourceCode) {
|
| - if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets)
|
| + if (!Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode))
|
| return;
|
| uiSourceCode.saveAs();
|
| }
|
| @@ -261,7 +262,7 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
|
| * @param {!Workspace.UISourceCode} uiSourceCode
|
| */
|
| _handleRemoveSnippet(uiSourceCode) {
|
| - if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets)
|
| + if (!Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSourceCode))
|
| return;
|
| uiSourceCode.remove();
|
| }
|
|
|