Index: ui/file_manager/file_manager/foreground/js/file_manager.js |
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js |
index 726be4e9724126afe77eee819a7f15a57c0aa508..b9290b81257a7b25cdaa52a4ba193010daef6523 100644 |
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js |
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js |
@@ -416,6 +416,21 @@ FileManager.prototype = /** @struct */ { |
this.directoryModel_, |
this.commandHandler); |
+ importer.importEnabled().then( |
+ function(enabled) { |
+ if (enabled) { |
+ this.importController_ = new importer.ImportController( |
+ new importer.RuntimeControllerEnvironment( |
+ this, |
+ this.selectionHandler_), |
+ /** @type {!importer.MediaScanner} */ ( |
+ this.mediaScanner_), |
+ /** @type {!importer.ImportRunner} */ ( |
+ this.mediaImportHandler_), |
+ new importer.RuntimeCommandWidget()); |
+ } |
+ }.bind(this)); |
+ |
assert(this.fileFilter_); |
assert(this.namingController_); |
assert(this.appStateController_); |
@@ -479,22 +494,6 @@ FileManager.prototype = /** @struct */ { |
this.commandHandler = new CommandHandler(this); |
- // Kick the import enabled promise to be sure it is loaded |
- // (and cached) for use by code that requires synchronous |
- // access (e.g. Commands). |
- importer.importEnabled().then( |
- function(enabled) { |
- if (enabled) { |
- this.importController_ = new importer.ImportController( |
- new importer.RuntimeControllerEnvironment(this), |
- /** @type {!importer.MediaScanner} */ ( |
- this.mediaScanner_), |
- /** @type {!importer.ImportRunner} */ ( |
- this.mediaImportHandler_), |
- new importer.RuntimeCommandWidget()); |
- } |
- }.bind(this)); |
- |
// TODO(hirono): Move the following block to the UI part. |
var commandButtons = this.dialogDom_.querySelectorAll('button[command]'); |
for (var j = 0; j < commandButtons.length; j++) |