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

Unified Diff: ui/file_manager/file_manager/background/js/media_import_handler.js

Issue 885653003: Files.app: Add deduplication code for imports to Google Drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. Created 5 years, 11 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: ui/file_manager/file_manager/background/js/media_import_handler.js
diff --git a/ui/file_manager/file_manager/background/js/media_import_handler.js b/ui/file_manager/file_manager/background/js/media_import_handler.js
index 0135363a2493de1a1392f2277b1cf3c93141a121..9c62f45f4bf072cfd9be5ef625a3f6e5839ffec2 100644
--- a/ui/file_manager/file_manager/background/js/media_import_handler.js
+++ b/ui/file_manager/file_manager/background/js/media_import_handler.js
@@ -311,7 +311,7 @@ importer.MediaImportHandler.ImportTask.prototype.importOne_ =
if (isDuplicate) {
// If the given file is a duplicate, don't import it again. Just
// update the progress indicator.
- // TODO(kenobi): Update import history to mark the dupe as sync'd.
+ this.markAsImported_(entry);
this.processedBytes_ += entry.size;
this.notify(importer.TaskQueue.UpdateType.PROGRESS);
return Promise.resolve();
@@ -427,6 +427,22 @@ importer.MediaImportHandler.ImportTask.prototype.markAsCopied_ =
});
};
+/**
+ * @param {!FileEntry} entry
+ * @param {!DirectoryEntry} destination
+ */
+importer.MediaImportHandler.ImportTask.prototype.markAsImported_ =
+ function(entry) {
+ this.remainingFilesCount_--;
+ this.historyLoader_.getHistory().then(
+ /** @param {!importer.ImportHistory} history */
+ function(history) {
+ history.markImported(
+ entry,
+ importer.Destination.GOOGLE_DRIVE);
+ });
+};
+
/** @private */
importer.MediaImportHandler.ImportTask.prototype.onSuccess_ = function() {
this.notify(importer.TaskQueue.UpdateType.SUCCESS);

Powered by Google App Engine
This is Rietveld 408576698