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.DebuggerSourceMapping} | 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 */ |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (this._button) | 224 if (this._button) |
225 return this._button.element; | 225 return this._button.element; |
226 | 226 |
227 this._sourcesView = sourcesView; | 227 this._sourcesView = sourcesView; |
228 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.Edito
rSelected, this._editorSelected.bind(this)); | 228 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.Edito
rSelected, this._editorSelected.bind(this)); |
229 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.Edito
rClosed, this._editorClosed.bind(this)); | 229 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.Edito
rClosed, this._editorClosed.bind(this)); |
230 | 230 |
231 this._button = new WebInspector.StatusBarButton(WebInspector.UIString("P
retty print"), "sources-toggle-pretty-print-status-bar-item"); | 231 this._button = new WebInspector.StatusBarButton(WebInspector.UIString("P
retty print"), "sources-toggle-pretty-print-status-bar-item"); |
232 this._button.toggled = false; | 232 this._button.toggled = false; |
233 this._button.addEventListener("click", this._toggleFormatScriptSource, t
his); | 233 this._button.addEventListener("click", this._toggleFormatScriptSource, t
his); |
234 this._updateButton(null); | 234 this._updateButton(sourcesView.currentUISourceCode()); |
235 | 235 |
236 return this._button.element; | 236 return this._button.element; |
237 }, | 237 }, |
238 | 238 |
239 /** | 239 /** |
240 * @param {?WebInspector.UISourceCode} uiSourceCode | 240 * @param {?WebInspector.UISourceCode} uiSourceCode |
241 * @return {boolean} | 241 * @return {boolean} |
242 */ | 242 */ |
243 _isFormatableScript: function(uiSourceCode) | 243 _isFormatableScript: function(uiSourceCode) |
244 { | 244 { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 var targets = WebInspector.targetManager.targets(); | 428 var targets = WebInspector.targetManager.targets(); |
429 for (var i = 0; i < targets.length; ++i) { | 429 for (var i = 0; i < targets.length; ++i) { |
430 var scriptMapping = /** @type {!WebInspector.FormatterScriptMapp
ing} */(this._scriptMappingByTarget.get(targets[i])); | 430 var scriptMapping = /** @type {!WebInspector.FormatterScriptMapp
ing} */(this._scriptMappingByTarget.get(targets[i])); |
431 WebInspector.debuggerWorkspaceBinding.setSourceMapping(targets[i
], formattedUISourceCode, scriptMapping); | 431 WebInspector.debuggerWorkspaceBinding.setSourceMapping(targets[i
], formattedUISourceCode, scriptMapping); |
432 } | 432 } |
433 this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMap
ping); | 433 this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMap
ping); |
434 } | 434 } |
435 } | 435 } |
436 } | 436 } |
OLD | NEW |