Commit 1ade33ea authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Allow DriveFS when native-only is requested for a dialog.

Drive is typically disallowed for directory-chooser dialogs because its
workaround for not having real files is only applied to files, but not
directories. With DriveFS, this is unnecessary since DriveFS files are
real so allow native or drive when native-only is requested when DriveFS
is enabled.

Change-Id: Ib56e7066cf6798d9d37ac2c2442f8fcf62a92be9
Reviewed-on: https://chromium-review.googlesource.com/1208992Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589102}
parent df79950d
......@@ -11,6 +11,7 @@
#include "base/json/json_writer.h"
#include "base/values.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chromeos/chromeos_features.h"
#include "net/base/escape.h"
namespace file_manager {
......@@ -116,7 +117,10 @@ GURL GetFileManagerMainPageUrlWithParams(
if (file_types) {
switch (file_types->allowed_paths) {
case ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH:
arg_value.SetString(kAllowedPaths, kNativePath);
if (base::FeatureList::IsEnabled(chromeos::features::kDriveFs))
arg_value.SetString(kAllowedPaths, kNativeOrDrivePath);
else
arg_value.SetString(kAllowedPaths, kNativePath);
break;
case ui::SelectFileDialog::FileTypeInfo::NATIVE_OR_DRIVE_PATH:
arg_value.SetString(kAllowedPaths, kNativeOrDrivePath);
......@@ -125,6 +129,8 @@ GURL GetFileManagerMainPageUrlWithParams(
arg_value.SetString(kAllowedPaths, kAnyPath);
break;
}
} else if (base::FeatureList::IsEnabled(chromeos::features::kDriveFs)) {
arg_value.SetString(kAllowedPaths, kNativeOrDrivePath);
} else {
arg_value.SetString(kAllowedPaths, kNativePath);
}
......
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