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

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

Issue 2859533004: DevTools: add command menu entries for adding new snippet, workspace folder (Closed)
Patch Set: Created 3 years, 8 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d1ac998834d415b1bd7788bad974a55ae21fe13..ea64e67917fb4b29fce7cdba4e0adcc2b2948e21 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
@@ -277,3 +277,27 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
this._handleRemoveSnippet(uiSourceCode);
}
};
+
+/**
+ * @implements {UI.ActionDelegate}
+ */
+Sources.SourcesNavigatorView.CreatingActionDelegate = class {
+ /**
+ * @override
+ * @param {!UI.Context} context
+ * @param {string} actionId
+ * @return {boolean}
+ */
+ handleAction(context, actionId) {
+ switch (actionId) {
+ case 'sources.create-snippet':
+ var uiSourceCode = Snippets.scriptSnippetModel.createScriptSnippet('');
+ Common.Revealer.reveal(uiSourceCode);
+ return true;
+ case 'sources.add-folder-to-workspace':
+ Workspace.isolatedFileSystemManager.addFileSystem();
+ return true;
+ }
+ return false;
+ }
+};
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698