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

Side by Side Diff: chrome/browser/resources/file_manager/js/file_copy_manager.js

Issue 10826241: File manager: use pre-bound "self" variable instead of "this". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {DirectoryEntry} root Root directory entry. 7 * @param {DirectoryEntry} root Root directory entry.
8 */ 8 */
9 function FileCopyManager(root) { 9 function FileCopyManager(root) {
10 this.copyTasks_ = []; 10 this.copyTasks_ = [];
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 self.sendOperationEvent_('copied', [entry]); 673 self.sendOperationEvent_('copied', [entry]);
674 onCopyCompleteBase(entry, size); 674 onCopyCompleteBase(entry, size);
675 } 675 }
676 676
677 function onCopyProgress(entry, size) { 677 function onCopyProgress(entry, size) {
678 task.updateFileCopyProgress(entry, size); 678 task.updateFileCopyProgress(entry, size);
679 self.sendProgressEvent_('PROGRESS'); 679 self.sendProgressEvent_('PROGRESS');
680 } 680 }
681 681
682 function onError(reason, data) { 682 function onError(reason, data) {
683 this.log_('serviceNextTaskEntry error: ' + reason + ':', data); 683 self.log_('serviceNextTaskEntry error: ' + reason + ':', data);
684 errorCallback(new FileCopyManager.Error(reason, data)); 684 errorCallback(new FileCopyManager.Error(reason, data));
685 } 685 }
686 686
687 function onFilesystemCopyComplete(sourceEntry, targetEntry) { 687 function onFilesystemCopyComplete(sourceEntry, targetEntry) {
688 // TODO(benchan): We currently do not know the size of data being 688 // TODO(benchan): We currently do not know the size of data being
689 // copied by FileEntry.copyTo(), so task.completedBytes will not be 689 // copied by FileEntry.copyTo(), so task.completedBytes will not be
690 // increased. We will address this issue once we need to use 690 // increased. We will address this issue once we need to use
691 // task.completedBytes to track the progress. 691 // task.completedBytes to track the progress.
692 self.sendOperationEvent_('copied', [sourceEntry, targetEntry]); 692 self.sendOperationEvent_('copied', [sourceEntry, targetEntry]);
693 onCopyCompleteBase(targetEntry, 0); 693 onCopyCompleteBase(targetEntry, 0);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 936
937 writer.write(file); 937 writer.write(file);
938 } 938 }
939 939
940 targetEntry.createWriter(onWriterCreated, errorCallback); 940 targetEntry.createWriter(onWriterCreated, errorCallback);
941 } 941 }
942 942
943 sourceEntry.file(onSourceFileFound, errorCallback); 943 sourceEntry.file(onSourceFileFound, errorCallback);
944 }; 944 };
945 945
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