OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 { | 526 { |
527 delete this._workingCopy; | 527 delete this._workingCopy; |
528 delete this._workingCopyGetter; | 528 delete this._workingCopyGetter; |
529 }, | 529 }, |
530 | 530 |
531 /** | 531 /** |
532 * @param {string} newWorkingCopy | 532 * @param {string} newWorkingCopy |
533 */ | 533 */ |
534 setWorkingCopy: function(newWorkingCopy) | 534 setWorkingCopy: function(newWorkingCopy) |
535 { | 535 { |
536 this._mimeType = this.canonicalMimeType(); | 536 if (!this._mimeType) |
| 537 this._mimeType = this.canonicalMimeType(); |
537 this._workingCopy = newWorkingCopy; | 538 this._workingCopy = newWorkingCopy; |
538 delete this._workingCopyGetter; | 539 delete this._workingCopyGetter; |
539 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCo
pyChanged); | 540 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCo
pyChanged); |
540 }, | 541 }, |
541 | 542 |
542 setWorkingCopyGetter: function(workingCopyGetter) | 543 setWorkingCopyGetter: function(workingCopyGetter) |
543 { | 544 { |
544 this._workingCopyGetter = workingCopyGetter; | 545 this._workingCopyGetter = workingCopyGetter; |
545 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCo
pyChanged); | 546 this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCo
pyChanged); |
546 }, | 547 }, |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 function persist() | 1078 function persist() |
1078 { | 1079 { |
1079 window.localStorage[key] = this._content; | 1080 window.localStorage[key] = this._content; |
1080 window.localStorage["revision-history"] = JSON.stringify(registry); | 1081 window.localStorage["revision-history"] = JSON.stringify(registry); |
1081 } | 1082 } |
1082 | 1083 |
1083 // Schedule async storage. | 1084 // Schedule async storage. |
1084 setTimeout(persist.bind(this), 0); | 1085 setTimeout(persist.bind(this), 0); |
1085 } | 1086 } |
1086 } | 1087 } |
OLD | NEW |