| Index: ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
|
| diff --git a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
|
| index 6e8d24ffbe702c91dd2da874efb8fe33d1fe2550..b5d4fe0aef3e3c563728e91ab0a297d7b1ed08cf 100644
|
| --- a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
|
| +++ b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
|
| @@ -47,14 +47,15 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
|
|
| // SelectFileDialog implementation.
|
| // |params| is user data we pass back via the Listener interface.
|
| - virtual void SelectFileImpl(Type type,
|
| - const string16& title,
|
| - const FilePath& default_path,
|
| - const FileTypeInfo* file_types,
|
| - int file_type_index,
|
| - const FilePath::StringType& default_extension,
|
| - gfx::NativeWindow owning_window,
|
| - void* params) OVERRIDE;
|
| + virtual void SelectFileImpl(
|
| + Type type,
|
| + const string16& title,
|
| + const base::FilePath& default_path,
|
| + const FileTypeInfo* file_types,
|
| + int file_type_index,
|
| + const base::FilePath::StringType& default_extension,
|
| + gfx::NativeWindow owning_window,
|
| + void* params) OVERRIDE;
|
|
|
| private:
|
| virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE;
|
| @@ -62,7 +63,7 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
| struct KDialogParams {
|
| // This constructor can only be run from the UI thread.
|
| KDialogParams(const std::string& type, const std::string& title,
|
| - const FilePath& default_path, gfx::NativeWindow parent,
|
| + const base::FilePath& default_path, gfx::NativeWindow parent,
|
| bool file_operation, bool multiple_selection,
|
| void* kdialog_params,
|
| void (SelectFileDialogImplKDE::*callback)(const std::string&,
|
| @@ -77,7 +78,7 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
|
|
| std::string type;
|
| std::string title;
|
| - FilePath default_path;
|
| + base::FilePath default_path;
|
| gfx::NativeWindow parent;
|
| bool file_operation;
|
| bool multiple_selection;
|
| @@ -93,7 +94,7 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
|
|
| // Get KDialog command line representing the Argv array for KDialog.
|
| void GetKDialogCommandLine(const std::string& type, const std::string& title,
|
| - const FilePath& default_path, gfx::NativeWindow parent,
|
| + const base::FilePath& default_path, gfx::NativeWindow parent,
|
| bool file_operation, bool multiple_selection, CommandLine* command_line);
|
|
|
| // Call KDialog on a worker thread and post results back to the caller
|
| @@ -101,10 +102,11 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
| void CallKDialogOutput(const KDialogParams& params);
|
|
|
| // Notifies the listener that a single file was chosen.
|
| - void FileSelected(const FilePath& path, void* params);
|
| + void FileSelected(const base::FilePath& path, void* params);
|
|
|
| // Notifies the listener that multiple files were chosen.
|
| - void MultiFilesSelected(const std::vector<FilePath>& files, void* params);
|
| + void MultiFilesSelected(const std::vector<base::FilePath>& files,
|
| + void* params);
|
|
|
| // Notifies the listener that no file was chosen (the action was canceled).
|
| // Dialog is passed so we can find that |params| pointer that was passed to
|
| @@ -112,19 +114,19 @@ class SelectFileDialogImplKDE : public ui::SelectFileDialogImpl {
|
| void FileNotSelected(void *params);
|
|
|
| void CreateSelectFolderDialog(const std::string& title,
|
| - const FilePath& default_path,
|
| + const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params);
|
|
|
| void CreateFileOpenDialog(const std::string& title,
|
| - const FilePath& default_path,
|
| + const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params);
|
|
|
| void CreateMultiFileOpenDialog(const std::string& title,
|
| - const FilePath& default_path,
|
| + const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params);
|
|
|
| void CreateSaveAsDialog(const std::string& title,
|
| - const FilePath& default_path,
|
| + const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params);
|
|
|
| // Common function for OnSelectSingleFileDialogResponse and
|
| @@ -162,10 +164,10 @@ SelectFileDialogImplKDE::~SelectFileDialogImplKDE() {
|
| void SelectFileDialogImplKDE::SelectFileImpl(
|
| Type type,
|
| const string16& title,
|
| - const FilePath& default_path,
|
| + const base::FilePath& default_path,
|
| const FileTypeInfo* file_types,
|
| int file_type_index,
|
| - const FilePath::StringType& default_extension,
|
| + const base::FilePath::StringType& default_extension,
|
| gfx::NativeWindow owning_window,
|
| void* params) {
|
| type_ = type;
|
| @@ -218,7 +220,8 @@ std::string SelectFileDialogImplKDE::GetMimeTypeFilterString() {
|
| for (size_t j = 0; j < file_types_.extensions[i].size(); ++j) {
|
| if (!file_types_.extensions[i][j].empty()) {
|
| std::string mime_type = base::nix::GetFileMimeType(
|
| - FilePath("name").ReplaceExtension(file_types_.extensions[i][j]));
|
| + base::FilePath("name").ReplaceExtension(
|
| + file_types_.extensions[i][j]));
|
| filter_set.insert(mime_type);
|
| }
|
| }
|
| @@ -260,7 +263,7 @@ void SelectFileDialogImplKDE::CallKDialogOutput(const KDialogParams& params) {
|
| }
|
|
|
| void SelectFileDialogImplKDE::GetKDialogCommandLine(const std::string& type,
|
| - const std::string& title, const FilePath& path,
|
| + const std::string& title, const base::FilePath& path,
|
| gfx::NativeWindow parent, bool file_operation, bool multiple_selection,
|
| CommandLine* command_line) {
|
| CHECK(command_line);
|
| @@ -282,7 +285,7 @@ void SelectFileDialogImplKDE::GetKDialogCommandLine(const std::string& type,
|
| command_line->AppendSwitch(type);
|
| // The path should never be empty. If it is, set it to PWD.
|
| if (path.empty())
|
| - command_line->AppendArgPath(FilePath("."));
|
| + command_line->AppendArgPath(base::FilePath("."));
|
| else
|
| command_line->AppendArgPath(path);
|
| // Depending on the type of the operation we need, get the path to the
|
| @@ -292,7 +295,8 @@ void SelectFileDialogImplKDE::GetKDialogCommandLine(const std::string& type,
|
| VLOG(1) << "KDialog command line: " << command_line->GetCommandLineString();
|
| }
|
|
|
| -void SelectFileDialogImplKDE::FileSelected(const FilePath& path, void* params) {
|
| +void SelectFileDialogImplKDE::FileSelected(const base::FilePath& path,
|
| + void* params) {
|
| if (type_ == SELECT_SAVEAS_FILE)
|
| *last_saved_path_ = path.DirName();
|
| else if (type_ == SELECT_OPEN_FILE)
|
| @@ -308,7 +312,7 @@ void SelectFileDialogImplKDE::FileSelected(const FilePath& path, void* params) {
|
| }
|
|
|
| void SelectFileDialogImplKDE::MultiFilesSelected(
|
| - const std::vector<FilePath>& files, void* params) {
|
| + const std::vector<base::FilePath>& files, void* params) {
|
| *last_opened_path_ = files[0].DirName();
|
| if (listener_)
|
| listener_->MultiFilesSelected(files, params);
|
| @@ -320,7 +324,7 @@ void SelectFileDialogImplKDE::FileNotSelected(void* params) {
|
| }
|
|
|
| void SelectFileDialogImplKDE::CreateSelectFolderDialog(
|
| - const std::string& title, const FilePath& default_path,
|
| + const std::string& title, const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void *params) {
|
| base::WorkerPool::PostTask(FROM_HERE,
|
| base::Bind(
|
| @@ -336,7 +340,7 @@ void SelectFileDialogImplKDE::CreateSelectFolderDialog(
|
| }
|
|
|
| void SelectFileDialogImplKDE::CreateFileOpenDialog(
|
| - const std::string& title, const FilePath& default_path,
|
| + const std::string& title, const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params) {
|
| base::WorkerPool::PostTask(FROM_HERE,
|
| base::Bind(
|
| @@ -352,7 +356,7 @@ void SelectFileDialogImplKDE::CreateFileOpenDialog(
|
| }
|
|
|
| void SelectFileDialogImplKDE::CreateMultiFileOpenDialog(
|
| - const std::string& title, const FilePath& default_path,
|
| + const std::string& title, const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params) {
|
| base::WorkerPool::PostTask(FROM_HERE,
|
| base::Bind(
|
| @@ -368,7 +372,7 @@ void SelectFileDialogImplKDE::CreateMultiFileOpenDialog(
|
| }
|
|
|
| void SelectFileDialogImplKDE::CreateSaveAsDialog(
|
| - const std::string& title, const FilePath& default_path,
|
| + const std::string& title, const base::FilePath& default_path,
|
| gfx::NativeWindow parent, void* params) {
|
| base::WorkerPool::PostTask(FROM_HERE,
|
| base::Bind(
|
| @@ -391,7 +395,7 @@ void SelectFileDialogImplKDE::SelectSingleFileHelper(const std::string& output,
|
| return;
|
| }
|
|
|
| - FilePath path(output);
|
| + base::FilePath path(output);
|
| if (allow_folder) {
|
| FileSelected(path, params);
|
| return;
|
| @@ -424,10 +428,10 @@ void SelectFileDialogImplKDE::OnSelectMultiFileDialogResponse(
|
|
|
| std::vector<std::string> filenames;
|
| Tokenize(output, "\n", &filenames);
|
| - std::vector<FilePath> filenames_fp;
|
| + std::vector<base::FilePath> filenames_fp;
|
| for (std::vector<std::string>::iterator iter = filenames.begin();
|
| iter != filenames.end(); ++iter) {
|
| - FilePath path(*iter);
|
| + base::FilePath path(*iter);
|
| if (CallDirectoryExistsOnUIThread(path))
|
| continue;
|
| filenames_fp.push_back(path);
|
|
|