Skip to content

Commit

Permalink
Use FOS_FORCEFILESYSTEM when using IFileOpenDialog
Browse files Browse the repository at this point in the history
This used to be a default option when using ::GetOpenFileName() but it
was not transferred over when upgrading to using the IFileDialog API.

Since some users liked the old behavior and it doesn't seem to have any
bad side-effects (it was used for years after all), this change ensure
that the FOS_FORCEFILESYSTEM option is used once again.

Bug: 930871
Change-Id: I6fc4669ccf13f28a8f029cd3bf10e27960e816ae
Reviewed-on: https://chromium-review.googlesource.com/c/1475889
Reviewed-by: Robert Liao <robliao@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633290}
  • Loading branch information
plmonette-zz authored and Commit Bot committed Feb 19, 2019
1 parent d3a55e7 commit 9b22ed2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/shell_dialogs/execute_select_file_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ bool RunOpenFileDialog(HWND owner,
return false;
}

// The FOS_FORCEFILESYSTEM option ensures that if the user enters a URL in the
// "File name" box, it will be downloaded locally and its new file path will
// be returned by the dialog. This was a default option in the deprecated
// GetOpenFileName API.
dialog_options |= FOS_FORCEFILESYSTEM;

if (!ConfigureDialog(file_open_dialog.Get(), title, ok_button_label,
default_path, filter, *filter_index, dialog_options)) {
return false;
Expand Down Expand Up @@ -267,7 +273,7 @@ bool ExecuteSelectFolder(HWND owner,
IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON);
}

DWORD dialog_options = FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM;
DWORD dialog_options = FOS_PICKFOLDERS;

std::vector<FileFilterSpec> no_filter;
int filter_index = 0;
Expand Down

0 comments on commit 9b22ed2

Please sign in to comment.