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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js

Issue 163083002: Files.app: Show error messages for the case the source file is not exists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js b/chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js
index b99b42f9a73eea4aae98f5c77317159e96d6d7c6..1cfe042f4c6ba7032685bc1909b398d5601f0f6f 100644
--- a/chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js
+++ b/chrome/browser/resources/file_manager/foreground/js/file_transfer_controller.js
@@ -240,13 +240,6 @@ FileTransferController.prototype = {
paste: function(dataTransfer, opt_destinationEntry, opt_effect) {
var sourceURLs = dataTransfer.getData('fs/sources') ?
dataTransfer.getData('fs/sources').split('\n') : [];
- util.URLsToEntries(sourceURLs, function(sourceEntries) {
- var destinationEntry =
- opt_destinationEntry || this.currentDirectoryContentEntry;
- // Start the pasting operation.
- this.fileOperationManager_.paste(sourceEntries, destinationEntry, toMove);
- }.bind(this));
-
// effectAllowed set in copy/paste handlers stay uninitialized. DnD handlers
// work fine.
var effectAllowed = dataTransfer.effectAllowed !== 'uninitialized' ?
@@ -254,6 +247,21 @@ FileTransferController.prototype = {
var toMove = effectAllowed === 'move' ||
(effectAllowed === 'copyMove' && opt_effect === 'move');
+ util.URLsToEntries(sourceURLs, function(sourceEntries) {
+ var destinationEntry =
+ opt_destinationEntry || this.currentDirectoryContentEntry;
+ // Start the pasting operation.
+ this.fileOperationManager_.paste(sourceEntries, destinationEntry, toMove);
+ }.bind(this), function(urls) {
+ for (var i = 0; i < urls.length; i++) {
+ var fileName = decodeURIComponent(urls[i].replace(/^.+\//, ''));
+ var event = new Event('source-not-found');
+ event.fileName = fileName;
+ event.progressType =
+ toMove ? ProgressItemType.MOVE : ProgressItemType.COPY;
+ this.dispatchEvent(event);
+ }
+ }.bind(this));
return toMove ? 'move' : 'copy';
},

Powered by Google App Engine
This is Rietveld 408576698