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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 WebInspector.LiveEditSupport.prototype = { | 42 WebInspector.LiveEditSupport.prototype = { |
43 /** | 43 /** |
44 * @param {!WebInspector.UISourceCode} uiSourceCode | 44 * @param {!WebInspector.UISourceCode} uiSourceCode |
45 * @return {!WebInspector.UISourceCode} | 45 * @return {!WebInspector.UISourceCode} |
46 */ | 46 */ |
47 uiSourceCodeForLiveEdit: function(uiSourceCode) | 47 uiSourceCodeForLiveEdit: function(uiSourceCode) |
48 { | 48 { |
49 var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0); | 49 var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0); |
50 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); | 50 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); |
51 var script = WebInspector.debuggerModel.scriptForId(debuggerModelLocatio
n.scriptId); | 51 var script = debuggerModelLocation.script(); |
52 var uiLocation = script.rawLocationToUILocation(0, 0); | 52 var uiLocation = script.rawLocationToUILocation(0, 0); |
53 | 53 |
54 // FIXME: Support live editing of scripts mapped to some file. | 54 // FIXME: Support live editing of scripts mapped to some file. |
55 if (uiLocation.uiSourceCode !== uiSourceCode) | 55 if (uiLocation.uiSourceCode !== uiSourceCode) |
56 return uiLocation.uiSourceCode; | 56 return uiLocation.uiSourceCode; |
57 if (this._uiSourceCodeForScriptId[script.scriptId]) | 57 if (this._uiSourceCodeForScriptId[script.scriptId]) |
58 return this._uiSourceCodeForScriptId[script.scriptId]; | 58 return this._uiSourceCodeForScriptId[script.scriptId]; |
59 | 59 |
60 console.assert(!script.isInlineScript()); | 60 console.assert(!script.isInlineScript()); |
61 var liveEditUISourceCode = this._workspaceProvider.addUniqueFileForURL(s
cript.sourceURL, script, true, script.isContentScript); | 61 var liveEditUISourceCode = this._workspaceProvider.addUniqueFileForURL(s
cript.sourceURL, script, true, script.isContentScript); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 checkMapping: function() | 170 checkMapping: function() |
171 { | 171 { |
172 }, | 172 }, |
173 | 173 |
174 __proto__: WebInspector.Object.prototype | 174 __proto__: WebInspector.Object.prototype |
175 } | 175 } |
176 | 176 |
177 /** @type {!WebInspector.LiveEditSupport} */ | 177 /** @type {!WebInspector.LiveEditSupport} */ |
178 WebInspector.liveEditSupport; | 178 WebInspector.liveEditSupport; |
OLD | NEW |