| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 this._removeMessageFromSource(message); | 251 this._removeMessageFromSource(message); |
| 252 Common.EventTarget.removeEventListeners(this._messageAndDecorationListeners)
; | 252 Common.EventTarget.removeEventListeners(this._messageAndDecorationListeners)
; |
| 253 | 253 |
| 254 this._persistenceBinding = binding; | 254 this._persistenceBinding = binding; |
| 255 | 255 |
| 256 for (var message of this._allMessages()) | 256 for (var message of this._allMessages()) |
| 257 this._addMessageToSource(message); | 257 this._addMessageToSource(message); |
| 258 this._installMessageAndDecorationListeners(); | 258 this._installMessageAndDecorationListeners(); |
| 259 this._updateStyle(); | 259 this._updateStyle(); |
| 260 this._decorateAllTypes(); | 260 this._decorateAllTypes(); |
| 261 this.onBindingChanged(); |
| 262 } |
| 263 |
| 264 /** |
| 265 * @protected |
| 266 */ |
| 267 onBindingChanged() { |
| 268 // Overriden in subclasses. |
| 261 } | 269 } |
| 262 | 270 |
| 263 _updateStyle() { | 271 _updateStyle() { |
| 264 this.element.classList.toggle( | 272 this.element.classList.toggle( |
| 265 'source-frame-unsaved-committed-changes', | 273 'source-frame-unsaved-committed-changes', |
| 266 Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)); | 274 Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)); |
| 267 this.setEditable(!this._canEditSource()); | 275 this.setEditable(!this._canEditSource()); |
| 268 } | 276 } |
| 269 | 277 |
| 270 onUISourceCodeContentChanged() { | 278 onUISourceCodeContentChanged() { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 | 694 |
| 687 /** | 695 /** |
| 688 * @param {!Workspace.UISourceCode.Message} a | 696 * @param {!Workspace.UISourceCode.Message} a |
| 689 * @param {!Workspace.UISourceCode.Message} b | 697 * @param {!Workspace.UISourceCode.Message} b |
| 690 * @return {number} | 698 * @return {number} |
| 691 */ | 699 */ |
| 692 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { | 700 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { |
| 693 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - | 701 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - |
| 694 Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; | 702 Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; |
| 695 }; | 703 }; |
| OLD | NEW |