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

Unified Diff: Source/devtools/front_end/SnippetStorage.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/ScriptsPanel.js ('k') | Source/devtools/front_end/UISourceCode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/SnippetStorage.js
diff --git a/Source/devtools/front_end/SnippetStorage.js b/Source/devtools/front_end/SnippetStorage.js
index 4bdc8736894c13eba99dcaec3c33631bcd862d5c..098a2542bfe689ab0384e103d006e46151d416b5 100644
--- a/Source/devtools/front_end/SnippetStorage.js
+++ b/Source/devtools/front_end/SnippetStorage.js
@@ -77,6 +77,19 @@ WebInspector.SnippetStorage.prototype = {
return this._snippets[id];
},
+ /**
+ * @param {string} name
+ * @return {WebInspector.Snippet}
+ */
+ snippetForName: function(name)
+ {
+ var snippets = Object.values(this._snippets);
+ for (var i = 0; i < snippets.length; ++i)
+ if (snippets[i].name === name)
+ return snippets[i];
+ return null;
+ },
+
_loadSettings: function()
{
var savedSnippets = this._snippetsSetting.get();
« no previous file with comments | « Source/devtools/front_end/ScriptsPanel.js ('k') | Source/devtools/front_end/UISourceCode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698