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

Unified Diff: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.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
Index: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
index e671825f4d97dbfaa5c9e9e24af5303c18db98f2..3626255d9a851a26885e85b174d017908a9b9719 100644
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
@@ -108,8 +108,11 @@ class SelectFileDialogImplGTK : public SelectFileDialogImpl,
// us when we were told to show the dialog.
void FileNotSelected(GtkWidget* dialog);
- GtkWidget* CreateSelectFolderDialog(const std::string& title,
- const base::FilePath& default_path, gfx::NativeWindow parent);
+ GtkWidget* CreateSelectFolderDialog(
+ Type type,
+ const std::string& title,
+ const base::FilePath& default_path,
+ gfx::NativeWindow parent);
GtkWidget* CreateFileOpenDialog(const std::string& title,
const base::FilePath& default_path, gfx::NativeWindow parent);
@@ -237,7 +240,8 @@ void SelectFileDialogImplGTK::SelectFileImpl(
GtkWidget* dialog = NULL;
switch (type) {
case SELECT_FOLDER:
- dialog = CreateSelectFolderDialog(title_string, default_path,
+ case SELECT_UPLOAD_FOLDER:
+ dialog = CreateSelectFolderDialog(type, title_string, default_path,
owning_window);
break;
case SELECT_OPEN_FILE:
@@ -396,17 +400,26 @@ GtkWidget* SelectFileDialogImplGTK::CreateFileOpenHelper(
}
GtkWidget* SelectFileDialogImplGTK::CreateSelectFolderDialog(
+ Type type,
const std::string& title,
const base::FilePath& default_path,
gfx::NativeWindow parent) {
- std::string title_string = !title.empty() ? title :
+ std::string title_string = title;
+ if (title_string.empty()) {
+ title_string = (type == SELECT_UPLOAD_FOLDER) ?
+ l10n_util::GetStringUTF8(IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE) :
l10n_util::GetStringUTF8(IDS_SELECT_FOLDER_DIALOG_TITLE);
+ }
+ std::string accept_button_label = (type == SELECT_UPLOAD_FOLDER) ?
+ l10n_util::GetStringUTF8(IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON) :
+ GTK_STOCK_OPEN;
GtkWidget* dialog =
gtk_file_chooser_dialog_new(title_string.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ accept_button_label.c_str(),
+ GTK_RESPONSE_ACCEPT,
NULL);
SetGtkTransientForAura(dialog, parent);
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_selection.js ('k') | chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698