Commit df0e2666 authored by fukino's avatar fukino Committed by Commit bot

Diable cloud import when Files.app launches as a dialog.

- instantiate ImportController only when the Files.app type is PAGE_FULL.
- remove unused flag 'importEnabled_'.

BUG=454148
TEST=manual test

Review URL: https://codereview.chromium.org/1109073002

Cr-Commit-Position: refs/heads/master@{#327305}
parent 6e85bb2f
......@@ -261,13 +261,6 @@ function FileManager() {
* @private
*/
this.initializeQueue_ = new AsyncUtil.Group();
/**
* Indicates whether cloud import is enabled. This is initialized in
* #initSettings.
* @private {boolean}
*/
this.importEnabled_ = true;
}
FileManager.prototype = /** @struct */ {
......@@ -374,17 +367,7 @@ FileManager.prototype = /** @struct */ {
(function() {
FileManager.prototype.initSettings_ = function(callback) {
this.appStateController_ = new AppStateController(this.dialogType);
var whenViewOptionsLoaded =
this.appStateController_.loadInitialViewOptions();
var whenImportFlagLoaded = importer.importEnabled().then(
function(enabled) {
this.importEnabled_ = enabled;
}.bind(this));
Promise.all([
whenViewOptionsLoaded,
whenImportFlagLoaded
]).then(callback);
this.appStateController_.loadInitialViewOptions().then(callback);
};
/**
......@@ -444,19 +427,21 @@ FileManager.prototype = /** @struct */ {
this.ui_.emptyFolder,
this.directoryModel_);
importer.importEnabled().then(
function(enabled) {
if (enabled) {
this.importController_ = new importer.ImportController(
new importer.RuntimeControllerEnvironment(
this,
assert(this.selectionHandler_)),
assert(this.mediaScanner_),
assert(this.mediaImportHandler_),
new importer.RuntimeCommandWidget(),
assert(this.tracker_));
}
}.bind(this));
if (this.dialogType === DialogType.FULL_PAGE) {
importer.importEnabled().then(
function(enabled) {
if (enabled) {
this.importController_ = new importer.ImportController(
new importer.RuntimeControllerEnvironment(
this,
assert(this.selectionHandler_)),
assert(this.mediaScanner_),
assert(this.mediaImportHandler_),
new importer.RuntimeCommandWidget(),
assert(this.tracker_));
}
}.bind(this));
}
assert(this.fileFilter_);
assert(this.namingController_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment