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

Unified Diff: ui/file_manager/file_manager/common/js/importer_common.js

Issue 792233009: Reflect scanning status in command UI. Only allow import once scanning is complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix FM.jstests.cc && Finalize scan results in MediaImportHandlerTest...unbreaking the test. Created 6 years 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/common/js/importer_common.js
diff --git a/ui/file_manager/file_manager/common/js/importer_common.js b/ui/file_manager/file_manager/common/js/importer_common.js
index f65c5d21f67d4868773ad64225541aa4726a78c3..3b77f1e9015c883fbe72bcdf0c615a601a44a3bd 100644
--- a/ui/file_manager/file_manager/common/js/importer_common.js
+++ b/ui/file_manager/file_manager/common/js/importer_common.js
@@ -5,6 +5,17 @@
// Shared cloud importer namespace
var importer = importer || {};
+/** @enum {string} */
+importer.ScanEvent = {
+ FINALIZED: 'finalized'
+};
+
+/**
+ * @typedef {function(
+ * !importer.ScanEvent, importer.ScanResult)}
+ */
+importer.ScanObserver;
+
/**
* Volume types eligible for the affections of Cloud Import.
* @private @const {!Array.<!VolumeManagerCommon.VolumeType>}
@@ -95,20 +106,7 @@ importer.importEnabled = function() {
'enable-cloud-backup',
/** @param {boolean} enabled */
function(enabled) {
- importer.lastKnownImportEnabled = enabled;
resolve(enabled);
});
});
};
-
-/**
- * The last known state for the cloud import feature being enabled.
- *
- * <p>NOTE: The "command" framework is fully synchronous, meaning
- * we have to answer questions, like "can execute" synchronously.
- * For this reason we cache the last result from importer.importEnabled().
- * It might be wrong once, but it won't be wrong for long.
- *
- * @type {boolean}
- */
-importer.lastKnownImportEnabled = false;

Powered by Google App Engine
This is Rietveld 408576698