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

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

Issue 2538413002: Postpone automatic popup of cloud backup details until ready to backup. (Closed)
Patch Set: Update import controller unittest to reflect UI flow change. Created 4 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
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/import_controller_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/import_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/import_controller.js b/ui/file_manager/file_manager/foreground/js/import_controller.js
index 343b1d2f33cd274ce04032488a00eb1e19c7e83d..a217242890392d25874cde149bac5da6085383de 100644
--- a/ui/file_manager/file_manager/foreground/js/import_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/import_controller.js
@@ -71,6 +71,13 @@ importer.ImportController =
*/
this.lastActivityState_ = importer.ActivityState.HIDDEN;
+ /**
+ * Whether the window was opened by plugging a media device and user hadn't
+ * navigated to other directories.
+ * @private {boolean}
+ */
+ this.isRightAfterPluggingMedia_ = false;
+
var listener = this.onScanEvent_.bind(this);
this.scanner_.addObserver(listener);
// Remove the observer when the foreground window is closed.
@@ -163,11 +170,7 @@ importer.ImportController.prototype.onVolumeUnmounted_ = function(volumeId) {
* @private
*/
importer.ImportController.prototype.onDirectoryChanged_ = function(event) {
- if (!event.previousDirEntry &&
- event.newDirEntry &&
- importer.isMediaDirectory(event.newDirEntry, this.environment_)) {
- this.commandWidget_.setDetailsVisible(true);
- }
+ this.isRightAfterPluggingMedia_ = !event.previousDirEntry;
this.scanManager_.reset();
if (this.isCurrentDirectoryScannable_()) {
@@ -390,6 +393,10 @@ importer.ImportController.prototype.checkState_ = function(opt_scan) {
this.updateUi_(
importer.ActivityState.READY, // to import...
opt_scan);
+ if (this.isRightAfterPluggingMedia_) {
+ this.isRightAfterPluggingMedia_ = false;
+ this.commandWidget_.setDetailsVisible(true);
+ }
}.bind(this))
.catch(importer.getLogger().catcher('import-controller-check-state'));
};
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/import_controller_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698