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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 }, | 113 }, |
114 | 114 |
115 _didEditContent: function(error) | 115 _didEditContent: function(error) |
116 { | 116 { |
117 if (error) { | 117 if (error) { |
118 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Err
or, true); | 118 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Err
or, true); |
119 return; | 119 return; |
120 } | 120 } |
121 }, | 121 }, |
122 | 122 |
| 123 beforeFormattedChange: function() { }, |
| 124 |
123 /** | 125 /** |
124 * @param {!WebInspector.Event} event | 126 * @param {!WebInspector.Event} event |
125 */ | 127 */ |
126 _onFormattedChanged: function(event) | 128 _onFormattedChanged: function(event) |
127 { | 129 { |
| 130 this.beforeFormattedChange(); |
128 var content = /** @type {string} */ (event.data.content); | 131 var content = /** @type {string} */ (event.data.content); |
129 this._textEditor.setReadOnly(this._uiSourceCode.formatted()); | 132 this._textEditor.setReadOnly(this._uiSourceCode.formatted()); |
130 var selection = this._textEditor.selection(); | 133 var selection = this._textEditor.selection(); |
131 this._innerSetContent(content); | 134 this._innerSetContent(content); |
132 var start = null; | 135 var start = null; |
133 var end = null; | 136 var end = null; |
134 if (this._uiSourceCode.formatted()) { | 137 if (this._uiSourceCode.formatted()) { |
135 start = event.data.newFormatter.originalToFormatted(selection.startL
ine, selection.startColumn); | 138 start = event.data.newFormatter.originalToFormatted(selection.startL
ine, selection.startColumn); |
136 end = event.data.newFormatter.originalToFormatted(selection.endLine,
selection.endColumn); | 139 end = event.data.newFormatter.originalToFormatted(selection.endLine,
selection.endColumn); |
137 } else { | 140 } else { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 contextMenu.appendSeparator(); | 196 contextMenu.appendSeparator(); |
194 }, | 197 }, |
195 | 198 |
196 dispose: function() | 199 dispose: function() |
197 { | 200 { |
198 this.detach(); | 201 this.detach(); |
199 }, | 202 }, |
200 | 203 |
201 __proto__: WebInspector.SourceFrame.prototype | 204 __proto__: WebInspector.SourceFrame.prototype |
202 } | 205 } |
OLD | NEW |