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 848de3884a24dbaba59e916d5ceaf00173d74fa6..6612b094d6b5f601a3bc0246685814ac89cad310 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 |
@@ -200,6 +200,9 @@ importer.MediaImportHandler.ImportTask = function( |
/** @private {number} Number of files deduped by content dedupe. */ |
this.dedupeCount_ = 0; |
+ |
+ /** @private {number} */ |
+ this.errorCount_ = 0; |
}; |
/** @struct */ |
@@ -464,9 +467,7 @@ importer.MediaImportHandler.ImportTask.prototype.onSuccess_ = function() { |
*/ |
importer.MediaImportHandler.ImportTask.prototype.onError_ = function(error) { |
this.notify(importer.TaskQueue.UpdateType.ERROR); |
- // TODO(kenobi): Impedence mismatch: this gets called per-file, which is |
- // different from onSuccess, which reports overall import success. |
- this.tracker_.send(metrics.ImportEvents.ERROR); |
+ this.errorCount_++; |
}; |
/** |
@@ -483,6 +484,8 @@ importer.MediaImportHandler.ImportTask.prototype.sendImportStats_ = function() { |
metrics.ImportEvents.FILE_COUNT |
.value(importFileCount)); |
+ this.tracker_.send(metrics.ImportEvents.ERROR.value(this.errorCount_)); |
+ |
// Send aggregate deduplication timings, to avoid flooding analytics with one |
// timing per file. |
var deduplicatorStats = this.deduplicator_.getStatistics(); |