#include "content/browser/file_system_access/file_system_chooser.h"
#include "base/files/file_path.h"
#include "base/i18n/file_util_icu.h"
#include "base/i18n/rtl.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/browser/file_system_access/file_system_access_error.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "net/base/mime_util.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/text_elider.h"
#include "ui/shell_dialogs/select_file_policy.h"
#include "ui/shell_dialogs/selected_file_info.h"
namespace content {
namespace {
constexpr int kMaxDescriptionLength = …;
constexpr int kMaxExtensionLength = …;
base::FilePath::StringType GetLastExtension(
const base::FilePath::StringType& extension) { … }
bool IsInvalidExtension(base::FilePath::StringType& extension) { … }
bool GetFileTypesFromAcceptsOption(
const blink::mojom::ChooseFileSystemEntryAcceptsOption& option,
std::vector<base::FilePath::StringType>* extensions,
std::u16string* description) { … }
ui::SelectFileDialog::FileTypeInfo ConvertAcceptsToFileTypeInfo(
const blink::mojom::AcceptsTypesInfoPtr& accepts_types_info) { … }
ui::SelectFileDialog::Type ValidateType(ui::SelectFileDialog::Type type) { … }
}
FileSystemChooser::Options::Options(
ui::SelectFileDialog::Type type,
blink::mojom::AcceptsTypesInfoPtr accepts_types_info,
std::u16string title,
base::FilePath default_directory,
base::FilePath suggested_name)
: … { … }
FileSystemChooser::Options::Options(const Options& other) = default;
base::FilePath FileSystemChooser::Options::ResolveSuggestedNameExtension(
base::FilePath suggested_name,
ui::SelectFileDialog::FileTypeInfo& file_types) { … }
void FileSystemChooser::CreateAndShow(
WebContents* web_contents,
const Options& options,
ResultCallback callback,
base::ScopedClosureRunner fullscreen_block) { … }
bool FileSystemChooser::IsShellIntegratedExtension(
const base::FilePath::StringType& extension) { … }
FileSystemChooser::FileSystemChooser(ui::SelectFileDialog::Type type,
ResultCallback callback,
base::ScopedClosureRunner fullscreen_block)
: … { … }
FileSystemChooser::~FileSystemChooser() { … }
void FileSystemChooser::FileSelected(const ui::SelectedFileInfo& file,
int index) { … }
void FileSystemChooser::MultiFilesSelected(
const std::vector<ui::SelectedFileInfo>& files) { … }
void FileSystemChooser::FileSelectionCanceled() { … }
}