diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 11:01:30 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 11:01:30 +0000 |
commit | e735f282b88becfa4c4c234750b509f6ddb1da9b (patch) | |
tree | 0c0d59b964a0c7541d3b60176ae1db7b4a926eac /chrome/browser/resources | |
parent | 38e77986f216332e1f0cf7ad220474c07ef09c8e (diff) | |
download | chromium_src-e735f282b88becfa4c4c234750b509f6ddb1da9b.zip chromium_src-e735f282b88becfa4c4c234750b509f6ddb1da9b.tar.gz chromium_src-e735f282b88becfa4c4c234750b509f6ddb1da9b.tar.bz2 |
Move from drive/other to drive/root should not use the copy+delete bypass.
BUG=244340
Review URL: https://chromiumcodereview.appspot.com/15785004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/file_manager/js/file_copy_manager.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/resources/file_manager/js/file_copy_manager.js b/chrome/browser/resources/file_manager/js/file_copy_manager.js index b29bd49..1339ff9 100644 --- a/chrome/browser/resources/file_manager/js/file_copy_manager.js +++ b/chrome/browser/resources/file_manager/js/file_copy_manager.js @@ -522,18 +522,18 @@ FileCopyManager.prototype.paste = function(files, directories, isCut, isOnDrive, }; /** - * Checks if source and target are on the same root. + * Checks if the move operation is avaiable between the given two locations. * * @param {DirectoryEntry} sourceEntry An entry from the source. * @param {DirectoryEntry} targetDirEntry Directory entry for the target. - * @param {boolean} targetOnDrive If target is on Drive. - * @return {boolean} Whether source and target dir are on the same root. + * @return {boolean} Whether we can move from the source to the target. */ -FileCopyManager.prototype.isOnSameRoot = function(sourceEntry, - targetDirEntry, - targetOnDrive) { - return PathUtil.getRootPath(sourceEntry.fullPath) == - PathUtil.getRootPath(targetDirEntry.fullPath); +FileCopyManager.prototype.isMovable = function(sourceEntry, + targetDirEntry) { + return (PathUtil.isDriveBasedPath(sourceEntry.fullPath) && + PathUtil.isDriveBasedPath(targetDirEntry.fullPath)) || + (PathUtil.getRootPath(sourceEntry.fullPath) == + PathUtil.getRootPath(targetDirEntry.fullPath)); }; /** @@ -556,9 +556,7 @@ FileCopyManager.prototype.queueCopy_ = function(targetDirEntry, // When copying files, null can be specified as source directory. var copyTask = new FileCopyManager.Task(targetDirEntry); if (deleteAfterCopy) { - // |sourecDirEntry| may be null, so let's check the root for the first of - // the entries scheduled to be copied. - if (this.isOnSameRoot(entries[0], targetDirEntry)) { + if (this.isMovable(entries[0], targetDirEntry)) { copyTask.move = true; } else { copyTask.deleteAfterCopy = true; |