OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 */ | 112 */ |
113 renameScriptSnippet: function(uiSourceCode, newName) | 113 renameScriptSnippet: function(uiSourceCode, newName) |
114 { | 114 { |
115 var breakpointLocations = this._removeBreakpoints(uiSourceCode); | 115 var breakpointLocations = this._removeBreakpoints(uiSourceCode); |
116 var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode); | 116 var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode); |
117 var snippet = this._snippetStorage.snippetForId(snippetId); | 117 var snippet = this._snippetStorage.snippetForId(snippetId); |
118 if (!snippet || !newName || snippet.name === newName) | 118 if (!snippet || !newName || snippet.name === newName) |
119 return; | 119 return; |
120 snippet.name = newName; | 120 snippet.name = newName; |
121 this._restoreBreakpoints(uiSourceCode, breakpointLocations); | 121 this._restoreBreakpoints(uiSourceCode, breakpointLocations); |
122 uiSourceCode.urlChanged(snippet.name); | |
123 }, | 122 }, |
124 | 123 |
125 /** | 124 /** |
126 * @param {WebInspector.UISourceCode} uiSourceCode | 125 * @param {WebInspector.UISourceCode} uiSourceCode |
127 * @param {string} newContent | 126 * @param {string} newContent |
128 */ | 127 */ |
129 _setScriptSnippetContent: function(uiSourceCode, newContent) | 128 _setScriptSnippetContent: function(uiSourceCode, newContent) |
130 { | 129 { |
131 var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode); | 130 var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode); |
132 var snippet = this._snippetStorage.snippetForId(snippetId); | 131 var snippet = this._snippetStorage.snippetForId(snippetId); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 515 } |
517 | 516 |
518 WebInspector.SnippetContentProvider.prototype = { | 517 WebInspector.SnippetContentProvider.prototype = { |
519 __proto__: WebInspector.StaticContentProvider.prototype | 518 __proto__: WebInspector.StaticContentProvider.prototype |
520 } | 519 } |
521 | 520 |
522 /** | 521 /** |
523 * @type {?WebInspector.ScriptSnippetModel} | 522 * @type {?WebInspector.ScriptSnippetModel} |
524 */ | 523 */ |
525 WebInspector.scriptSnippetModel = null; | 524 WebInspector.scriptSnippetModel = null; |
OLD | NEW |