Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_model.js

Issue 257803013: Fix a value of EntryChangedKind that is dispatched when zipping completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/background/js/file_operation_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/directory_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index bc21f5530b8d47c148dc9c9acb1411cec130341a..7736e0f58287bbe84b5a3347f3d1a79ece61b427 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -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;
}
};
« no previous file with comments | « ui/file_manager/file_manager/background/js/file_operation_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698