| 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 21 matching lines...) Expand all Loading... |
| 32 * @param {!WebInspector.UISourceCode} uiSourceCode | 32 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 33 */ | 33 */ |
| 34 WebInspector.UISourceCodeFrame = function(uiSourceCode) | 34 WebInspector.UISourceCodeFrame = function(uiSourceCode) |
| 35 { | 35 { |
| 36 this._uiSourceCode = uiSourceCode; | 36 this._uiSourceCode = uiSourceCode; |
| 37 WebInspector.SourceFrame.call(this, this._uiSourceCode); | 37 WebInspector.SourceFrame.call(this, this._uiSourceCode); |
| 38 this.textEditor.setAutocompleteDelegate(new WebInspector.SimpleAutocompleteD
elegate()); | 38 this.textEditor.setAutocompleteDelegate(new WebInspector.SimpleAutocompleteD
elegate()); |
| 39 | 39 |
| 40 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._onWorkingCopyChanged, this); | 40 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._onWorkingCopyChanged, this); |
| 41 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._onWorkingCopyCommitted, this); | 41 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._onWorkingCopyCommitted, this); |
| 42 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Message
Added, this._onMessageAdded, this); |
| 43 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Message
Removed, this._onMessageRemoved, this); |
| 42 this._updateStyle(); | 44 this._updateStyle(); |
| 43 } | 45 } |
| 44 | 46 |
| 45 WebInspector.UISourceCodeFrame.prototype = { | 47 WebInspector.UISourceCodeFrame.prototype = { |
| 46 /** | 48 /** |
| 47 * @return {!WebInspector.UISourceCode} | 49 * @return {!WebInspector.UISourceCode} |
| 48 */ | 50 */ |
| 49 uiSourceCode: function() | 51 uiSourceCode: function() |
| 50 { | 52 { |
| 51 return this._uiSourceCode; | 53 return this._uiSourceCode; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 this._checkContentUpdated(); | 88 this._checkContentUpdated(); |
| 87 }, | 89 }, |
| 88 | 90 |
| 89 _checkContentUpdated: function() | 91 _checkContentUpdated: function() |
| 90 { | 92 { |
| 91 if (!this.loaded || !this.isShowing()) | 93 if (!this.loaded || !this.isShowing()) |
| 92 return; | 94 return; |
| 93 this._uiSourceCode.checkContentUpdated(); | 95 this._uiSourceCode.checkContentUpdated(); |
| 94 }, | 96 }, |
| 95 | 97 |
| 98 /** |
| 99 * @param {!WebInspector.Event} evt |
| 100 */ |
| 101 _onMessageAdded: function(evt) |
| 102 { |
| 103 var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data); |
| 104 this.addMessageToSource(new WebInspector.SourceFrameMessage(m.text(), m.
level(), m.location())); |
| 105 }, |
| 106 |
| 107 /** |
| 108 * @param {!WebInspector.Event} evt |
| 109 */ |
| 110 _onMessageRemoved: function(evt) |
| 111 { |
| 112 var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data); |
| 113 this.removeMessageFromSource(new WebInspector.SourceFrameMessage(m.text(
), m.level(), m.location())); |
| 114 }, |
| 115 |
| 96 commitEditing: function() | 116 commitEditing: function() |
| 97 { | 117 { |
| 98 if (!this._uiSourceCode.isDirty()) | 118 if (!this._uiSourceCode.isDirty()) |
| 99 return; | 119 return; |
| 100 | 120 |
| 101 this._muteSourceCodeEvents = true; | 121 this._muteSourceCodeEvents = true; |
| 102 this._uiSourceCode.commitWorkingCopy(); | 122 this._uiSourceCode.commitWorkingCopy(); |
| 103 delete this._muteSourceCodeEvents; | 123 delete this._muteSourceCodeEvents; |
| 104 }, | 124 }, |
| 105 | 125 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 277 |
| 258 dispose: function() | 278 dispose: function() |
| 259 { | 279 { |
| 260 this.element.remove(); | 280 this.element.remove(); |
| 261 this._onResize(); | 281 this._onResize(); |
| 262 delete this._uiSourceCodeFrame; | 282 delete this._uiSourceCodeFrame; |
| 263 }, | 283 }, |
| 264 | 284 |
| 265 __proto__: WebInspector.Infobar.prototype | 285 __proto__: WebInspector.Infobar.prototype |
| 266 } | 286 } |
| OLD | NEW |