Commit f41d5e23 authored by hirono@chromium.org's avatar hirono@chromium.org

Fix a value of EntryChangedKind that is dispatched when zipping completes.

Previously the name of the enum value was wrong. This CL fixes it:
EntryChangedKind.CREATE -> EntryChangedKind.CREATED.

BUG=364258
TEST=manually

Review URL: https://codereview.chromium.org/257803013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266562 0039d316-1c4b-4281-b951-d872f2087c98
parent 818308e6
...@@ -939,7 +939,7 @@ FileOperationManager.ZipTask.prototype.run = function( ...@@ -939,7 +939,7 @@ FileOperationManager.ZipTask.prototype.run = function(
this.zipBaseDirEntry, this.zipBaseDirEntry,
destPath, destPath,
function(entry) { function(entry) {
entryChangedCallback(util.EntryChangedKind.CREATE, entry); entryChangedCallback(util.EntryChangedKind.CREATED, entry);
successCallback(); successCallback();
}, },
function(error) { function(error) {
......
...@@ -492,32 +492,42 @@ DirectoryModel.prototype.onEntryChanged = function(kind, entry) { ...@@ -492,32 +492,42 @@ DirectoryModel.prototype.onEntryChanged = function(kind, entry) {
this.isSearching()) this.isSearching())
return; return;
if (kind == util.EntryChangedKind.CREATED) { switch (kind) {
// Refresh the cache. case util.EntryChangedKind.CREATED:
this.metadataCache_.clear([entry], '*'); // Refresh the cache.
entry.getParent(function(parentEntry) { this.metadataCache_.clear([entry], '*');
if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) { entry.getParent(function(parentEntry) {
// Do nothing if current directory changed during async operations.
return;
}
this.currentDirContents_.prefetchMetadata([entry], function() {
if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) { if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) {
// Do nothing if current directory changed during async operations. // Do nothing if current directory changed during async operations.
return; return;
} }
this.currentDirContents_.prefetchMetadata([entry], function() {
var index = this.findIndexByEntry_(entry); if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) {
if (index >= 0) // Do nothing if current directory changed during async operations.
this.getFileList().replaceItem(this.getFileList().item(index), entry); return;
else }
this.getFileList().push(entry);
var index = this.findIndexByEntry_(entry);
if (index >= 0) {
this.getFileList().replaceItem(
this.getFileList().item(index), entry);
} else {
this.getFileList().push(entry);
}
}.bind(this));
}.bind(this)); }.bind(this));
}.bind(this)); break;
} else {
// This is the delete event. case util.EntryChangedKind.DELETED:
var index = this.findIndexByEntry_(entry); // This is the delete event.
if (index >= 0) var index = this.findIndexByEntry_(entry);
this.getFileList().splice(index, 1); if (index >= 0)
this.getFileList().splice(index, 1);
break;
default:
console.error('Invalid EntryChangedKind: ' + kind);
break;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment