| Index: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| index 7eabf80f2088320c8953c14ea60ad78e9427006a..5f6535427c30df755a3276a4ee2211b6da475f0b 100644
|
| --- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| +++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| @@ -165,7 +165,7 @@ FileTransferController.prototype = {
|
| * @this {FileTransferController}
|
| * @param {DataTransfer} dataTransfer DataTransfer from the event.
|
| * @param {string} effectAllowed Value must be valid for the
|
| - * |dataTransfer.effectAllowed| property ('move', 'copy', 'copyMove').
|
| + * |dataTransfer.effectAllowed| property.
|
| */
|
| cutOrCopy_: function(dataTransfer, effectAllowed) {
|
| // Existence of the volumeInfo is checked in canXXX methods.
|
| @@ -329,8 +329,9 @@ FileTransferController.prototype = {
|
| // work fine.
|
| var effectAllowed = dataTransfer.effectAllowed !== 'uninitialized' ?
|
| dataTransfer.effectAllowed : dataTransfer.getData('fs/effectallowed');
|
| - var toMove = effectAllowed === 'move' ||
|
| - (effectAllowed === 'copyMove' && opt_effect === 'move');
|
| + var toMove = util.isDropEffectAllowed(effectAllowed, 'move') &&
|
| + (!util.isDropEffectAllowed(effectAllowed, 'copy') ||
|
| + opt_effect === 'move');
|
| var destinationEntry =
|
| opt_destinationEntry || this.currentDirectoryContentEntry;
|
| var entries;
|
| @@ -489,9 +490,9 @@ FileTransferController.prototype = {
|
| var canCut = this.canCutOrDrag_(dt);
|
| if (canCopy || canCut) {
|
| if (canCopy && canCut) {
|
| - this.cutOrCopy_(dt, 'copyMove');
|
| + this.cutOrCopy_(dt, 'all');
|
| } else if (canCopy) {
|
| - this.cutOrCopy_(dt, 'copy');
|
| + this.cutOrCopy_(dt, 'copyLink');
|
| } else {
|
| this.cutOrCopy_(dt, 'move');
|
| }
|
| @@ -1047,19 +1048,19 @@ FileTransferController.prototype = {
|
| return 'none';
|
| if (destinationLocationInfo.isReadOnly)
|
| return 'none';
|
| - if (event.dataTransfer.effectAllowed === 'move')
|
| - return 'move';
|
| - // TODO(mtomasz): Use volumeId instead of comparing roots, as soon as
|
| - // volumeId gets unique.
|
| - if (event.dataTransfer.effectAllowed === 'copyMove' &&
|
| - this.getSourceRootURL_(event.dataTransfer) ===
|
| - destinationLocationInfo.volumeInfo.fileSystem.root.toURL() &&
|
| - !event.ctrlKey) {
|
| - return 'move';
|
| - }
|
| - if (event.dataTransfer.effectAllowed === 'copyMove' &&
|
| - event.shiftKey) {
|
| - return 'move';
|
| + if (util.isDropEffectAllowed(event.dataTransfer.effectAllowed, 'move')) {
|
| + if (!util.isDropEffectAllowed(event.dataTransfer.effectAllowed, 'copy'))
|
| + return 'move';
|
| + // TODO(mtomasz): Use volumeId instead of comparing roots, as soon as
|
| + // volumeId gets unique.
|
| + if (this.getSourceRootURL_(event.dataTransfer) ===
|
| + destinationLocationInfo.volumeInfo.fileSystem.root.toURL() &&
|
| + !event.ctrlKey) {
|
| + return 'move';
|
| + }
|
| + if (event.shiftKey) {
|
| + return 'move';
|
| + }
|
| }
|
| return 'copy';
|
| },
|
|
|