| Index: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| index 4fa5b554791586c37976b94c5f63d1532deb9929..1fe1bb5d05d80bf1ebfb7e97769099ac26be3f18 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
|
| @@ -75,6 +75,7 @@ Workspace.UISourceCode = class extends Common.Object {
|
| this._workingCopy = null;
|
| /** @type {?function() : string} */
|
| this._workingCopyGetter = null;
|
| + this._mightHaveChanges = false;
|
| }
|
|
|
| /**
|
| @@ -318,6 +319,7 @@ Workspace.UISourceCode = class extends Common.Object {
|
| if (!lastRevision || lastRevision._content !== this._content) {
|
| var revision = new Workspace.Revision(this, this._content, new Date());
|
| this._history.push(revision);
|
| + this.mightHaveChanges = true;
|
| }
|
|
|
| this._innerResetWorkingCopy();
|
| @@ -331,6 +333,15 @@ Workspace.UISourceCode = class extends Common.Object {
|
| }
|
| }
|
|
|
| + /**
|
| + * @return {!Promise<boolean>}
|
| + */
|
| + hasChanges() {
|
| + if (!this.mightHaveChanges)
|
| + return Promise.resolve(false);
|
| + return this.requestOriginalContent().then(content => this.mightHaveChanges = content !== this.workingCopy());
|
| + }
|
| +
|
| saveAs() {
|
| Workspace.fileManager.save(this._url, this.workingCopy(), true, callback.bind(this));
|
| Workspace.fileManager.close(this._url);
|
| @@ -442,6 +453,7 @@ Workspace.UISourceCode = class extends Common.Object {
|
| }
|
|
|
| _workingCopyChanged() {
|
| + this.mightHaveChanges = true;
|
| this._removeAllMessages();
|
| this.dispatchEventToListeners(Workspace.UISourceCode.Events.WorkingCopyChanged, this);
|
| this._project.workspace().dispatchEventToListeners(
|
|
|