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

Unified Diff: ui/file_manager/file_manager/foreground/js/dialog_action_controller.js

Issue 749603002: Revert of Refoctoring FileSelection and FileSelectionHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/foreground/js/dialog_action_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js
index b71cb5e84037c4e88e5f89488427e1f19bd8cbb0..369161c98e681909b5b7b66b4ce7d5feec582ae6 100644
--- a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js
@@ -116,8 +116,7 @@
dialogFooter.filenameInput.addEventListener(
'input', this.updateOkButton_.bind(this));
fileSelectionHandler.addEventListener(
- FileSelectionHandler.EventType.CHANGE_THROTTLED,
- this.onFileSelectionChanged_.bind(this));
+ 'change', this.onFileSelectionChanged_.bind(this));
dialogFooter.initFileTypeFilter(
this.fileTypes_, launchParam.includeAllFiles);
@@ -412,13 +411,7 @@
this.dialogFooter_.filenameInput.value = selection.entries[0].name;
}
- selection.completeInit().then(function() {
- if (this.fileSelectionHandler_.selection !== selection)
- return;
- this.updateOkButton_();
- if (!this.dialogFooter_.okButton.disable)
- util.testSendMessage('dialog-ready');
- }.bind(this));
+ this.updateOkButton_();
};
/**
@@ -449,19 +442,27 @@
return;
}
+ var isDriveOffline =
+ this.volumeManager_.getDriveConnectionState().type ===
+ VolumeManagerCommon.DriveConnectionType.OFFLINE;
+ var filesAvailable =
+ !this.directoryModel_.isOnDrive() ||
+ !isDriveOffline ||
+ selection.allDriveFilesPresent;
+
if (this.dialogType_ === DialogType.SELECT_OPEN_FILE) {
this.dialogFooter_.okButton.disabled =
+ !filesAvailable ||
selection.directoryCount !== 0 ||
- selection.fileCount !== 1 ||
- !this.fileSelectionHandler_.isAvailable();
+ selection.fileCount !== 1;
return;
}
if (this.dialogType_ === DialogType.SELECT_OPEN_MULTI_FILE) {
this.dialogFooter_.okButton.disabled =
+ !filesAvailable ||
selection.directoryCount !== 0 ||
- selection.fileCount === 0 ||
- !this.fileSelectionHandler_.isAvailable();
+ selection.fileCount === 0;
return;
}

Powered by Google App Engine
This is Rietveld 408576698