OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @implements {WebInspector.SourceMapping} | 7 * @implements {WebInspector.DebuggerSourceMapping} |
8 * @param {!WebInspector.Target} target | 8 * @param {!WebInspector.Target} target |
9 * @param {!WebInspector.ScriptFormatterEditorAction} editorAction | 9 * @param {!WebInspector.ScriptFormatterEditorAction} editorAction |
10 */ | 10 */ |
11 WebInspector.FormatterScriptMapping = function(target, editorAction) | 11 WebInspector.FormatterScriptMapping = function(target, editorAction) |
12 { | 12 { |
13 this._target = target; | 13 this._target = target; |
14 this._editorAction = editorAction; | 14 this._editorAction = editorAction; |
15 } | 15 } |
16 | 16 |
17 WebInspector.FormatterScriptMapping.prototype = { | 17 WebInspector.FormatterScriptMapping.prototype = { |
18 /** | 18 /** |
19 * @param {!WebInspector.RawLocation} rawLocation | 19 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
20 * @return {?WebInspector.UILocation} | 20 * @return {?WebInspector.UILocation} |
21 */ | 21 */ |
22 rawLocationToUILocation: function(rawLocation) | 22 rawLocationToUILocation: function(rawLocation) |
23 { | 23 { |
24 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); | 24 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); |
25 var script = debuggerModelLocation.script(); | 25 var script = debuggerModelLocation.script(); |
26 var uiSourceCode = this._editorAction._uiSourceCodes.get(script); | 26 var uiSourceCode = this._editorAction._uiSourceCodes.get(script); |
27 if (!uiSourceCode) | 27 if (!uiSourceCode) |
28 return null; | 28 return null; |
29 | 29 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 426 |
427 var targets = WebInspector.targetManager.targets(); | 427 var targets = WebInspector.targetManager.targets(); |
428 for (var i = 0; i < targets.length; ++i) { | 428 for (var i = 0; i < targets.length; ++i) { |
429 var scriptMapping = /** @type {!WebInspector.FormatterScriptMapp
ing} */(this._scriptMappingByTarget.get(targets[i])); | 429 var scriptMapping = /** @type {!WebInspector.FormatterScriptMapp
ing} */(this._scriptMappingByTarget.get(targets[i])); |
430 WebInspector.debuggerWorkspaceBinding.setSourceMapping(targets[i
], formattedUISourceCode, scriptMapping); | 430 WebInspector.debuggerWorkspaceBinding.setSourceMapping(targets[i
], formattedUISourceCode, scriptMapping); |
431 } | 431 } |
432 this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMap
ping); | 432 this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMap
ping); |
433 } | 433 } |
434 } | 434 } |
435 } | 435 } |
OLD | NEW |