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

Side by Side Diff: chrome/browser/resources/file_manager/background/js/file_operation_manager.js

Issue 166263002: Fix copy number counting in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Review fix Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Utilities for FileOperationManager. 8 * Utilities for FileOperationManager.
9 */ 9 */
10 var fileOperationUtil = {}; 10 var fileOperationUtil = {};
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (this.cancelRequested_) { 629 if (this.cancelRequested_) {
630 errorCallback(new FileOperationManager.Error( 630 errorCallback(new FileOperationManager.Error(
631 util.FileOperationErrorType.FILESYSTEM_ERROR, 631 util.FileOperationErrorType.FILESYSTEM_ERROR,
632 util.createDOMError(util.FileError.ABORT_ERR))); 632 util.createDOMError(util.FileError.ABORT_ERR)));
633 return; 633 return;
634 } 634 }
635 progressCallback(); 635 progressCallback();
636 this.processEntry_( 636 this.processEntry_(
637 entry, this.targetDirEntry, 637 entry, this.targetDirEntry,
638 function(sourceEntry, destinationEntry) { 638 function(sourceEntry, destinationEntry) {
639 // Finalize the entry's progress state.
640 var sourceEntryURL = sourceEntry.toURL();
641 var processedEntry =
642 this.processingEntries[index][sourceEntryURL];
643
644 // Update current source index.
645 this.processingSourceIndex_ = index + 1;
646 this.processedBytes = this.calcProcessedBytes_();
647
648 // The destination entry may be null, if the copied file got 639 // The destination entry may be null, if the copied file got
649 // deleted just after copying. 640 // deleted just after copying.
650 if (destinationEntry) { 641 if (destinationEntry) {
651 entryChangedCallback( 642 entryChangedCallback(
652 util.EntryChangedKind.CREATED, destinationEntry); 643 util.EntryChangedKind.CREATED, destinationEntry);
653 } 644 }
654 }.bind(this), 645 }.bind(this),
655 function(sourceEntry, size) { 646 function(sourceEntry, size) {
656 var sourceEntryURL = sourceEntry.toURL(); 647 var sourceEntryURL = sourceEntry.toURL();
657 var processedEntry = 648 var processedEntry =
658 this.processingEntries[index][sourceEntryURL]; 649 this.processingEntries[index][sourceEntryURL];
659 if (processedEntry) { 650 if (processedEntry) {
660 this.processedBytes += size - processedEntry.processedBytes; 651 this.processedBytes += size - processedEntry.processedBytes;
661 processedEntry.processedBytes = size; 652 processedEntry.processedBytes = size;
662 progressCallback(); 653 progressCallback();
663 } 654 }
664 }.bind(this), 655 }.bind(this),
665 callback, 656 function() {
657 // Update current source index and processing bytes.
658 this.processingSourceIndex_ = index + 1;
659 this.processedBytes = this.calcProcessedBytes_();
660 callback();
661 }.bind(this),
666 errorCallback); 662 errorCallback);
667 }, 663 },
668 function() { 664 function() {
669 if (this.deleteAfterCopy) { 665 if (this.deleteAfterCopy) {
670 deleteOriginals(); 666 deleteOriginals();
671 } else { 667 } else {
672 successCallback(); 668 successCallback();
673 } 669 }
674 }.bind(this), 670 }.bind(this),
675 this); 671 this);
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 1341
1346 /** 1342 /**
1347 * Generates new task ID. 1343 * Generates new task ID.
1348 * 1344 *
1349 * @return {string} New task ID. 1345 * @return {string} New task ID.
1350 * @private 1346 * @private
1351 */ 1347 */
1352 FileOperationManager.prototype.generateTaskId_ = function() { 1348 FileOperationManager.prototype.generateTaskId_ = function() {
1353 return 'file-operation-' + this.taskIdCounter_++; 1349 return 'file-operation-' + this.taskIdCounter_++;
1354 }; 1350 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698