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

Unified Diff: Source/devtools/front_end/sources/NavigatorView.js

Issue 316153002: DevTools: Polish uiSourceCode context menu on sources panel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 6 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 | Source/devtools/front_end/sources/SourcesPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/NavigatorView.js
diff --git a/Source/devtools/front_end/sources/NavigatorView.js b/Source/devtools/front_end/sources/NavigatorView.js
index 88af5224e8e984341a975f383c40c752db2df307..0db57839f6204ef047c7e149f061ed0980a19e35 100644
--- a/Source/devtools/front_end/sources/NavigatorView.js
+++ b/Source/devtools/front_end/sources/NavigatorView.js
@@ -316,6 +316,14 @@ WebInspector.NavigatorView.prototype = {
},
/**
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ */
+ _handleContextMenuRename: function(uiSourceCode)
+ {
+ this.rename(uiSourceCode, false);
+ },
+
+ /**
* @param {!WebInspector.Project} project
* @param {string} path
*/
@@ -350,12 +358,14 @@ WebInspector.NavigatorView.prototype = {
contextMenu.appendSeparator();
var project = uiSourceCode.project();
- var path = uiSourceCode.parentPath();
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Refresh parent" : "Refresh Parent"), this._handleContextMenuRefresh.bind(this, project, path));
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Duplicate file" : "Duplicate File"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode));
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Exclude parent folder" : "Exclude Parent Folder"), this._handleContextMenuExclude.bind(this, project, path));
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Delete file" : "Delete File"), this._handleContextMenuDelete.bind(this, uiSourceCode));
- contextMenu.appendSeparator();
+ if (project.type() === WebInspector.projectTypes.FileSystem) {
+ var path = uiSourceCode.parentPath();
+ contextMenu.appendItem(WebInspector.UIString("Rename\u2026"), this._handleContextMenuRename.bind(this, uiSourceCode));
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Make a copy\u2026" : "Make a Copy\u2026"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode));
+ contextMenu.appendItem(WebInspector.UIString("Delete"), this._handleContextMenuDelete.bind(this, uiSourceCode));
+ contextMenu.appendSeparator();
+ }
+
this._appendAddFolderItem(contextMenu);
contextMenu.show();
},
« no previous file with comments | « no previous file | Source/devtools/front_end/sources/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698