#include "ui/shell_dialogs/select_file_dialog.h"
#include <stddef.h>
#include <algorithm>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/sequence_checker.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/task/single_thread_task_runner.h"
#include "base/third_party/icu/icu_utf.h"
#include "build/build_config.h"
#include "ui/shell_dialogs/select_file_dialog_factory.h"
#include "ui/shell_dialogs/select_file_policy.h"
#include "ui/shell_dialogs/selected_file_info.h"
#include "url/gurl.h"
namespace {
ui::SelectFileDialogFactory* dialog_factory_ = …;
void TruncateStringToSize(base::FilePath::StringType* string, size_t size) { … }
}
namespace ui {
void SelectFileDialog::Listener::MultiFilesSelected(
const std::vector<SelectedFileInfo>& files) { … }
SelectFileDialog::FileTypeInfo::FileTypeInfo() = default;
SelectFileDialog::FileTypeInfo::FileTypeInfo(const FileTypeInfo& other) =
default;
SelectFileDialog::FileTypeInfo::FileTypeInfo(FileExtensionList in_extensions)
: … { … }
SelectFileDialog::FileTypeInfo::FileTypeInfo(
std::vector<FileExtensionList> in_extensions)
: … { … }
SelectFileDialog::FileTypeInfo::FileTypeInfo(
std::vector<FileExtensionList> in_extensions,
std::vector<std::u16string> in_descriptions)
: … { … }
SelectFileDialog::FileTypeInfo::~FileTypeInfo() = default;
void SelectFileDialog::SetFactory(
std::unique_ptr<ui::SelectFileDialogFactory> factory) { … }
scoped_refptr<SelectFileDialog> SelectFileDialog::Create(
Listener* listener,
std::unique_ptr<ui::SelectFilePolicy> policy) { … }
base::FilePath SelectFileDialog::GetShortenedFilePath(
const base::FilePath& path) { … }
#if BUILDFLAG(IS_ANDROID)
void SelectFileDialog::SetAcceptTypes(std::vector<std::u16string> types) {}
void SelectFileDialog::SetUseMediaCapture(bool use_media_capture) {}
void SelectFileDialog::SetOpenWritable(bool open_writable) {}
#endif
void SelectFileDialog::SelectFile(
Type type,
const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
const base::FilePath::StringType& default_extension,
gfx::NativeWindow owning_window,
const GURL* caller) { … }
bool SelectFileDialog::HasMultipleFileTypeChoices() { … }
SelectFileDialog::SelectFileDialog(Listener* listener,
std::unique_ptr<ui::SelectFilePolicy> policy)
: … { … }
SelectFileDialog::~SelectFileDialog() { … }
void SelectFileDialog::CancelFileSelection() { … }
}