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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/file_manager.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
Index: chrome/browser/resources/file_manager/foreground/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/file_manager.js b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
index cb4f5cb8ecfcff3008b2b8dd3e9fa87199bb3b1b..d8ffb8230c1748be9f4c99700102891da1508085 100644
--- a/chrome/browser/resources/file_manager/foreground/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
@@ -399,6 +399,26 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.blinkSelection.bind(this));
controller.addEventListener('selection-cut',
this.blinkSelection.bind(this));
+ controller.addEventListener('source-not-found',
+ this.onSourceNotFound_.bind(this));
+ };
+
+ /**
+ * Handles an error that the source entry of file operation is not found.
+ * @private
+ */
+ FileManager.prototype.onSourceNotFound_ = function(event) {
+ // Ensure this.sourceNotFoundErrorCount_ is integer.
+ this.sourceNotFoundErrorCount_ = ~~this.sourceNotFoundErrorCount_;
+ var item = new ProgressCenterItem();
+ item.id = 'source-not-found-' + this.sourceNotFoundErrorCount_;
+ if (event.progressType === ProgressItemType.COPY)
+ item.message = strf('COPY_SOURCE_NOT_FOUND_ERROR', event.fileName);
+ else if (event.progressType === ProgressItemType.MOVE)
+ item.message = strf('MOVE_SOURCE_NOT_FOUND_ERROR', event.fileName);
+ item.state = ProgressItemState.ERROR;
+ this.backgroundPage_.background.progressCenter.updateItem(item);
+ this.sourceNotFoundErrorCount_++;
};
/**

Powered by Google App Engine
This is Rietveld 408576698