Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Unified Diff: ui/shell_dialogs/select_file_dialog_win.cc

Issue 18627002: Change dialog texts for folder upload to explicitly indicate it's for 'Uploading' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/shell_dialogs/select_file_dialog_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/shell_dialogs/select_file_dialog_win.cc
diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc
index ba2ec00efdfb4d3abd905ab1036448471b72a05b..eff7a493c199b8e61ebf15ee704dc806eca6d159 100644
--- a/ui/shell_dialogs/select_file_dialog_win.cc
+++ b/ui/shell_dialogs/select_file_dialog_win.cc
@@ -581,9 +581,16 @@ void SelectFileDialogImpl::SelectFileImpl(
base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled,
base::Unretained(listener_)));
return;
- } else if (type == SELECT_FOLDER) {
+ } else if (type == SELECT_FOLDER || type == SELECT_UPLOAD_FOLDER) {
+ base::string16 title_string = title;
+ if (type == SELECT_UPLOAD_FOLDER && title_string.empty()) {
+ // If it's for uploading don't use default dialog title to
+ // make sure we clearly tell it's for uploading.
+ title_string = l10n_util::GetStringUTF16(
+ IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE);
+ }
aura::HandleSelectFolder(
- UTF16ToWide(title),
+ UTF16ToWide(title_string),
base::Bind(&ui::SelectFileDialog::Listener::FileSelected,
base::Unretained(listener_)),
base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled,
@@ -632,8 +639,15 @@ void SelectFileDialogImpl::ExecuteSelectFile(
base::FilePath path = params.default_path;
bool success = false;
unsigned filter_index = params.file_type_index;
- if (params.type == SELECT_FOLDER) {
- success = RunSelectFolderDialog(params.title,
+ if (params.type == SELECT_FOLDER || params.type == SELECT_UPLOAD_FOLDER) {
+ std::wstring title = params.title;
+ if (title.empty() && params.type == SELECT_UPLOAD_FOLDER) {
+ // If it's for uploading don't use default dialog title to
+ // make sure we clearly tell it's for uploading.
+ title = UTF16ToWide(
+ l10n_util::GetStringUTF16(IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE));
+ }
+ success = RunSelectFolderDialog(title,
params.run_state.owner,
&path);
} else if (params.type == SELECT_SAVEAS_FILE) {
« no previous file with comments | « ui/shell_dialogs/select_file_dialog_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698