summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-02 09:30:16 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-02 09:30:16 +0000
commit597ccbc69e8236671f3944fbc8e56a1776f67018 (patch)
tree204e70eca43f2485086ae2b7e7b7e403faf79e4d
parentff2ddd3af49fcdfe0a73bfb60791906a1d2285c0 (diff)
downloadchromium_src-597ccbc69e8236671f3944fbc8e56a1776f67018.zip
chromium_src-597ccbc69e8236671f3944fbc8e56a1776f67018.tar.gz
chromium_src-597ccbc69e8236671f3944fbc8e56a1776f67018.tar.bz2
Files.app: stop adding entries when a scan is cancelled during metadata fetching.
BUG=390801 Review URL: https://codereview.chromium.org/361133003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280985 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/file_manager/file_manager/foreground/js/directory_contents.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js
index 336e62d..486d4ca 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_contents.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -678,10 +678,11 @@ DirectoryContents.prototype.onNewEntries_ = function(refresh, entries) {
this.processNewEntriesQueue_.run(function(callbackOuter) {
var finish = function() {
- // Update the filelist without waiting the metadata.
- this.fileList_.push.apply(this.fileList_, entriesFiltered);
- cr.dispatchSimpleEvent(this, 'scan-updated');
-
+ if (!this.scanCancelled_) {
+ // Update the filelist without waiting the metadata.
+ this.fileList_.push.apply(this.fileList_, entriesFiltered);
+ cr.dispatchSimpleEvent(this, 'scan-updated');
+ }
callbackOuter();
}.bind(this);
// Because the prefetchMetadata can be slow, throttling by splitting entries