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

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: Fixed. 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
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f5ecbe4bbd6358c3b5b6631a813bd4997e3053c8 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,22 @@ FileTransferController.prototype = {
var toMove = effectAllowed === 'move' ||
(effectAllowed === 'copyMove' && opt_effect === 'move');
+ util.URLsToEntries(sourceURLs, function(sourceEntries, failureUrls) {
+ var destinationEntry =
+ opt_destinationEntry || this.currentDirectoryContentEntry;
+ // Start the pasting operation.
+ this.fileOperationManager_.paste(sourceEntries, destinationEntry, toMove);
+
+ // Publish events for failureUrls.
+ for (var i = 0; i < failureUrls.length; i++) {
+ var fileName = decodeURIComponent(failureUrls[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';
},
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698