| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 forceLoadOnCheckContent() { | 276 forceLoadOnCheckContent() { |
| 277 this._forceLoadOnCheckContent = true; | 277 this._forceLoadOnCheckContent = true; |
| 278 } | 278 } |
| 279 | 279 |
| 280 /** | 280 /** |
| 281 * @return {!Promise<?string>} | 281 * @return {!Promise<?string>} |
| 282 */ | 282 */ |
| 283 requestOriginalContent() { | 283 requestOriginalContent() { |
| 284 var callback; | 284 return this._project.requestOriginalFileContent(this); |
| 285 var promise = new Promise(fulfill => callback = fulfill); | |
| 286 this._project.requestFileContent(this, callback); | |
| 287 return promise; | |
| 288 } | 285 } |
| 289 | 286 |
| 290 /** | 287 /** |
| 291 * @param {string} content | 288 * @param {string} content |
| 292 */ | 289 */ |
| 293 _commitContent(content) { | 290 _commitContent(content) { |
| 294 if (this._project.canSetFileContent()) { | 291 if (this._project.canSetFileContent()) { |
| 295 this._project.setFileContent(this, content, function() {}); | 292 this._project.setFileContent(this, content, function() {}); |
| 296 } else if (this._url && Workspace.fileManager.isURLSaved(this._url)) { | 293 } else if (this._url && Workspace.fileManager.isURLSaved(this._url)) { |
| 297 Workspace.fileManager.save(this._url, content, false, function() {}); | 294 Workspace.fileManager.save(this._url, content, false, function() {}); |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 Workspace.UISourceCodeMetadata = class { | 917 Workspace.UISourceCodeMetadata = class { |
| 921 /** | 918 /** |
| 922 * @param {?Date} modificationTime | 919 * @param {?Date} modificationTime |
| 923 * @param {?number} contentSize | 920 * @param {?number} contentSize |
| 924 */ | 921 */ |
| 925 constructor(modificationTime, contentSize) { | 922 constructor(modificationTime, contentSize) { |
| 926 this.modificationTime = modificationTime; | 923 this.modificationTime = modificationTime; |
| 927 this.contentSize = contentSize; | 924 this.contentSize = contentSize; |
| 928 } | 925 } |
| 929 }; | 926 }; |
| OLD | NEW |