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

Unified Diff: Source/devtools/front_end/ScriptsNavigator.js

Issue 14672033: DevTools: Make snippets renaming work through SnippetsProjectDelegate. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 7 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 | « Source/devtools/front_end/ScriptSnippetModel.js ('k') | Source/devtools/front_end/ScriptsPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ScriptsNavigator.js
diff --git a/Source/devtools/front_end/ScriptsNavigator.js b/Source/devtools/front_end/ScriptsNavigator.js
index 8a2ff6f79596ca584dc01e1227f7223a379636b1..5e7e441cc9fc45f7aa371d6d2da8ad2ec5d72f8a 100644
--- a/Source/devtools/front_end/ScriptsNavigator.js
+++ b/Source/devtools/front_end/ScriptsNavigator.js
@@ -41,17 +41,18 @@ WebInspector.ScriptsNavigator = function()
this._scriptsView = new WebInspector.NavigatorView();
this._scriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._scriptSelected, this);
this._scriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemSearchStarted, this._itemSearchStarted, this);
+ this._scriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemRenamingRequested, this._itemRenamingRequested, this);
this._contentScriptsView = new WebInspector.NavigatorView();
this._contentScriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._scriptSelected, this);
this._contentScriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemSearchStarted, this._itemSearchStarted, this);
+ this._contentScriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemRenamingRequested, this._itemRenamingRequested, this);
this._snippetsView = new WebInspector.SnippetsNavigatorView();
this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._scriptSelected, this);
this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.ItemSearchStarted, this._itemSearchStarted, this);
- this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.FileRenamed, this._fileRenamed, this);
+ this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.ItemRenamingRequested, this._itemRenamingRequested, this);
this._snippetsView.addEventListener(WebInspector.SnippetsNavigatorView.Events.SnippetCreationRequested, this._snippetCreationRequested, this);
- this._snippetsView.addEventListener(WebInspector.SnippetsNavigatorView.Events.ItemRenamingRequested, this._itemRenamingRequested, this);
this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ScriptsTab, WebInspector.UIString("Sources"), this._scriptsView);
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab);
@@ -64,7 +65,6 @@ WebInspector.ScriptsNavigator.Events = {
SnippetCreationRequested: "SnippetCreationRequested",
ItemRenamingRequested: "ItemRenamingRequested",
ItemSearchStarted: "ItemSearchStarted",
- FileRenamed: "FileRenamed"
}
WebInspector.ScriptsNavigator.ScriptsTab = "scripts";
@@ -150,14 +150,6 @@ WebInspector.ScriptsNavigator.prototype = {
/**
* @param {WebInspector.Event} event
*/
- _fileRenamed: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ScriptsNavigator.Events.FileRenamed, event.data);
- },
-
- /**
- * @param {WebInspector.Event} event
- */
_itemRenamingRequested: function(event)
{
this.dispatchEventToListeners(WebInspector.ScriptsNavigator.Events.ItemRenamingRequested, event.data);
@@ -185,8 +177,7 @@ WebInspector.SnippetsNavigatorView = function()
}
WebInspector.SnippetsNavigatorView.Events = {
- SnippetCreationRequested: "SnippetCreationRequested",
- ItemRenamingRequested: "ItemRenamingRequested"
+ SnippetCreationRequested: "SnippetCreationRequested"
}
WebInspector.SnippetsNavigatorView.prototype = {
@@ -199,7 +190,7 @@ WebInspector.SnippetsNavigatorView.prototype = {
var contextMenu = new WebInspector.ContextMenu(event);
if (uiSourceCode) {
contextMenu.appendItem(WebInspector.UIString("Run"), this._handleEvaluateSnippet.bind(this, uiSourceCode));
- contextMenu.appendItem(WebInspector.UIString("Rename"), this.handleRename.bind(this, uiSourceCode));
+ contextMenu.appendItem(WebInspector.UIString("Rename"), this.requestRename.bind(this, uiSourceCode));
contextMenu.appendItem(WebInspector.UIString("Remove"), this._handleRemoveSnippet.bind(this, uiSourceCode));
contextMenu.appendSeparator();
}
@@ -220,14 +211,6 @@ WebInspector.SnippetsNavigatorView.prototype = {
/**
* @param {WebInspector.UISourceCode} uiSourceCode
*/
- handleRename: function(uiSourceCode)
- {
- this.dispatchEventToListeners(WebInspector.ScriptsNavigator.Events.ItemRenamingRequested, uiSourceCode);
- },
-
- /**
- * @param {WebInspector.UISourceCode} uiSourceCode
- */
_handleRemoveSnippet: function(uiSourceCode)
{
if (uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets)
« no previous file with comments | « Source/devtools/front_end/ScriptSnippetModel.js ('k') | Source/devtools/front_end/ScriptsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698