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

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

Issue 1701163003: Hide non-native volumes when saving files from the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 10 months 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/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 404bb3cb8c4ac461a27db23b1b2298ab79cb648d..811a998886cbac758d56b30467a1f28a3e13a18c 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -745,24 +745,27 @@ FileManager.prototype = /** @struct */ {
* @private
*/
FileManager.prototype.initVolumeManager_ = function() {
- // Auto resolving to local path does not work for folders (e.g., dialog for
- // loading unpacked extensions).
- var noLocalPathResolution =
- DialogType.isFolderDialog(this.launchParams_.type);
+ var allowedPaths = this.launchParams_.allowedPaths;
+ // Files.app native implementation create snapshot files for non-native
+ // files. But it does not work for folders (e.g., dialog for loading
+ // unpacked extensions).
+ if (allowedPaths === AllowedPaths.NATIVE_PATH &&
+ !DialogType.isFolderDialog(this.launchParams_.type) &&
+ this.launchParams_.type != DialogType.SELECT_SAVEAS_FILE) {
+ allowedPaths = AllowedPaths.ANY_PATH;
+ }
- // If this condition is false, VolumeManagerWrapper hides all drive
- // related event and data, even if Drive is enabled on preference.
+ // VolumeManagerWrapper hides virtual file system related event and data
+ // even depends on the value of |supportVirtualPath|. If it is
+ // VirtualPathSupport.NO_VIRTUAL_PATH, it hides Drive even if Drive is
+ // enabled on preference.
// In other words, even if Drive is disabled on preference but Files.app
// should show Drive when it is re-enabled, then the value should be set to
// true.
// Note that the Drive enabling preference change is listened by
// DriveIntegrationService, so here we don't need to take care about it.
- var nonNativeEnabled =
- !noLocalPathResolution || !this.launchParams_.shouldReturnLocalPath;
this.volumeManager_ = new VolumeManagerWrapper(
- /** @type {VolumeManagerWrapper.NonNativeVolumeStatus} */
- (nonNativeEnabled),
- this.backgroundPage_);
+ allowedPaths, this.backgroundPage_);
};
/**

Powered by Google App Engine
This is Rietveld 408576698