| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {WebInspector.SourcesView.EditorAction} | 8 * @implements {WebInspector.SourcesView.EditorAction} |
| 9 */ | 9 */ |
| 10 WebInspector.InplaceFormatterEditorAction = function() | 10 WebInspector.InplaceFormatterEditorAction = function() |
| 11 { | 11 { |
| 12 } | 12 }; |
| 13 | 13 |
| 14 WebInspector.InplaceFormatterEditorAction.prototype = { | 14 WebInspector.InplaceFormatterEditorAction.prototype = { |
| 15 /** | 15 /** |
| 16 * @param {!WebInspector.Event} event | 16 * @param {!WebInspector.Event} event |
| 17 */ | 17 */ |
| 18 _editorSelected: function(event) | 18 _editorSelected: function(event) |
| 19 { | 19 { |
| 20 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data
); | 20 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data
); |
| 21 this._updateButton(uiSourceCode); | 21 this._updateButton(uiSourceCode); |
| 22 }, | 22 }, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 var sourceFrame = this._sourcesView.viewForFile(uiSourceCode); | 109 var sourceFrame = this._sourcesView.viewForFile(uiSourceCode); |
| 110 var start = [0, 0]; | 110 var start = [0, 0]; |
| 111 if (sourceFrame) { | 111 if (sourceFrame) { |
| 112 var selection = sourceFrame.selection(); | 112 var selection = sourceFrame.selection(); |
| 113 start = formatterMapping.originalToFormatted(selection.startLine
, selection.startColumn); | 113 start = formatterMapping.originalToFormatted(selection.startLine
, selection.startColumn); |
| 114 } | 114 } |
| 115 uiSourceCode.setWorkingCopy(formattedContent); | 115 uiSourceCode.setWorkingCopy(formattedContent); |
| 116 this._sourcesView.showSourceLocation(uiSourceCode, start[0], start[1
]); | 116 this._sourcesView.showSourceLocation(uiSourceCode, start[0], start[1
]); |
| 117 } | 117 } |
| 118 }, | 118 }, |
| 119 } | 119 }; |
| OLD | NEW |