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(
this.zipBaseDirEntry,
destPath,
function(entry) {
entryChangedCallback(util.EntryChangedKind.CREATE, entry);
entryChangedCallback(util.EntryChangedKind.CREATED, entry);
successCallback();
},
function(error) {
......
......@@ -492,32 +492,42 @@ DirectoryModel.prototype.onEntryChanged = function(kind, entry) {
this.isSearching())
return;
if (kind == util.EntryChangedKind.CREATED) {
// Refresh the cache.
this.metadataCache_.clear([entry], '*');
entry.getParent(function(parentEntry) {
if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) {
// Do nothing if current directory changed during async operations.
return;
}
this.currentDirContents_.prefetchMetadata([entry], function() {
switch (kind) {
case util.EntryChangedKind.CREATED:
// Refresh the cache.
this.metadataCache_.clear([entry], '*');
entry.getParent(function(parentEntry) {
if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) {
// Do nothing if current directory changed during async operations.
return;
}
var index = this.findIndexByEntry_(entry);
if (index >= 0)
this.getFileList().replaceItem(this.getFileList().item(index), entry);
else
this.getFileList().push(entry);
this.currentDirContents_.prefetchMetadata([entry], function() {
if (!util.isSameEntry(this.getCurrentDirEntry(), parentEntry)) {
// Do nothing if current directory changed during async operations.
return;
}
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));
} else {
// This is the delete event.
var index = this.findIndexByEntry_(entry);
if (index >= 0)
this.getFileList().splice(index, 1);
break;
case util.EntryChangedKind.DELETED:
// This is the delete event.
var index = this.findIndexByEntry_(entry);
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