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 var MAX_DRAG_THUMBAIL_COUNT = 4; | 5 var MAX_DRAG_THUMBAIL_COUNT = 4; |
6 | 6 |
7 /** | 7 /** |
8 * Global (placed in the window object) variable name to hold internal | 8 * Global (placed in the window object) variable name to hold internal |
9 * file dragging information. Needed to show visual feedback while dragging | 9 * file dragging information. Needed to show visual feedback while dragging |
10 * since DataTransfer object is in protected state. Reachable from other | 10 * since DataTransfer object is in protected state. Reachable from other |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // queryCommandEnabled returns true if event.returnValue is false. | 391 // queryCommandEnabled returns true if event.returnValue is false. |
392 event.returnValue = !this.canPasteOrDrop_(event.clipboardData); | 392 event.returnValue = !this.canPasteOrDrop_(event.clipboardData); |
393 }, | 393 }, |
394 | 394 |
395 canPasteOrDrop_: function(dataTransfer, opt_destinationPath) { | 395 canPasteOrDrop_: function(dataTransfer, opt_destinationPath) { |
396 var destinationPath = opt_destinationPath || | 396 var destinationPath = opt_destinationPath || |
397 this.directoryModel_.getCurrentDirPath(); | 397 this.directoryModel_.getCurrentDirPath(); |
398 if (this.directoryModel_.isPathReadOnly(destinationPath)) { | 398 if (this.directoryModel_.isPathReadOnly(destinationPath)) { |
399 return false; | 399 return false; |
400 } | 400 } |
| 401 if (util.isSpecialReadonlyDirectory(destinationPath)) |
| 402 return false; |
401 | 403 |
402 if (!dataTransfer.types || dataTransfer.types.indexOf('fs/tag') == -1) | 404 if (!dataTransfer.types || dataTransfer.types.indexOf('fs/tag') == -1) |
403 return false; // Unsupported type of content. | 405 return false; // Unsupported type of content. |
404 if (dataTransfer.getData('fs/tag') == '') { | 406 if (dataTransfer.getData('fs/tag') == '') { |
405 // Data protected. Other checks are not possible but it makes sense to | 407 // Data protected. Other checks are not possible but it makes sense to |
406 // let the user try. | 408 // let the user try. |
407 return true; | 409 return true; |
408 } | 410 } |
409 | 411 |
410 var directories = dataTransfer.getData('fs/directories').split('\n'). | 412 var directories = dataTransfer.getData('fs/directories').split('\n'). |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 return 'move'; | 521 return 'move'; |
520 } | 522 } |
521 if (event.dataTransfer.effectAllowed == 'copyMove' && | 523 if (event.dataTransfer.effectAllowed == 'copyMove' && |
522 event.shiftKey) { | 524 event.shiftKey) { |
523 return 'move'; | 525 return 'move'; |
524 } | 526 } |
525 return 'copy'; | 527 return 'copy'; |
526 } | 528 } |
527 }; | 529 }; |
528 | 530 |
OLD | NEW |