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

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: Created 7 years, 6 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
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 d4b51ebff0c8245dbeabb7fdf117cc14b464c270..7f49b20534055fd72174a8b4b77699c0e786d954 100644
--- a/ui/shell_dialogs/select_file_dialog_win.cc
+++ b/ui/shell_dialogs/select_file_dialog_win.cc
@@ -575,9 +575,16 @@ void SelectFileDialogImpl::SelectFileImpl(
base::Bind(&ui::SelectFileDialog::Listener::MultiFilesSelected,
base::Unretained(listener_)));
return;
- } else if (type == SELECT_FOLDER) {
+ } else if (type == SELECT_FOLDER || type == SELECT_UPLOAD_FOLDER) {
+ std::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_)));
return;
@@ -624,8 +631,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) {
« ui/shell_dialogs/select_file_dialog.h ('K') | « 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