| OLD | NEW |
| 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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 var sourceFileUrl = sourceEntry.toURL(); | 809 var sourceFileUrl = sourceEntry.toURL(); |
| 810 var targetFileUrl = targetDirEntry.toURL() + '/' + | 810 var targetFileUrl = targetDirEntry.toURL() + '/' + |
| 811 encodeURIComponent(targetRelativePath); | 811 encodeURIComponent(targetRelativePath); |
| 812 var transferedBytes = 0; | 812 var transferedBytes = 0; |
| 813 | 813 |
| 814 function onFileTransferCompleted() { | 814 function onFileTransferCompleted() { |
| 815 self.cancelCallback_ = null; | 815 self.cancelCallback_ = null; |
| 816 chrome.fileBrowserPrivate.onFileTransfersUpdated.removeListener( | 816 chrome.fileBrowserPrivate.onFileTransfersUpdated.removeListener( |
| 817 onFileTransfersUpdated); | 817 onFileTransfersUpdated); |
| 818 if (chrome.extension.lastError) { | 818 if (chrome.extension.lastError) { |
| 819 this.log_( | 819 self.log_( |
| 820 'Error copying ' + sourceFileUrl + ' to ' + targetFileUrl); | 820 'Error copying ' + sourceFileUrl + ' to ' + targetFileUrl); |
| 821 onFilesystemError({ | 821 onFilesystemError({ |
| 822 code: chrome.extension.lastError.message, | 822 code: chrome.extension.lastError.message, |
| 823 toGDrive: task.targetOnGData, | 823 toGDrive: task.targetOnGData, |
| 824 sourceFileUrl: sourceFileUrl | 824 sourceFileUrl: sourceFileUrl |
| 825 }); | 825 }); |
| 826 } else { | 826 } else { |
| 827 targetDirEntry.getFile(targetRelativePath, {}, | 827 targetDirEntry.getFile(targetRelativePath, {}, |
| 828 function(targetEntry) { | 828 function(targetEntry) { |
| 829 targetEntry.getMetadata(function(metadata) { | 829 targetEntry.getMetadata(function(metadata) { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 */ | 1056 */ |
| 1057 FileCopyManager.prototype.sendDeleteEvent_ = function(task, reason) { | 1057 FileCopyManager.prototype.sendDeleteEvent_ = function(task, reason) { |
| 1058 this.sendEvent_('delete', { | 1058 this.sendEvent_('delete', { |
| 1059 reason: reason, | 1059 reason: reason, |
| 1060 id: task.id, | 1060 id: task.id, |
| 1061 urls: task.entries.map(function(e) { | 1061 urls: task.entries.map(function(e) { |
| 1062 return util.makeFilesystemUrl(e.fullPath); | 1062 return util.makeFilesystemUrl(e.fullPath); |
| 1063 }) | 1063 }) |
| 1064 }); | 1064 }); |
| 1065 }; | 1065 }; |
| OLD | NEW |