summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 09:14:08 +0000
committerlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 09:14:08 +0000
commit8cddbd8649f8cb5a27d48b40f46746335be1787a (patch)
tree9a4faa029c092d86cdeb12042f1cc10851b68af9
parent52c14950c0ea8b556b5ee3b6c414e67b0682d517 (diff)
downloadchromium_src-8cddbd8649f8cb5a27d48b40f46746335be1787a.zip
chromium_src-8cddbd8649f8cb5a27d48b40f46746335be1787a.tar.gz
chromium_src-8cddbd8649f8cb5a27d48b40f46746335be1787a.tar.bz2
gtk: Make directory selection work with upload type
(<input webkitdirectory>). Right now it hits NOTREACHED(). uploads have type = SELECT_UPLOAD_FOLDER. They should be treated same as SELECT_OPEN_FILE and SELECT_FOLDER to save the last opened directory path. BUG=None Test=Manually with a packaged app that has input element: <input type="file" webkitdirectory id="directory"/> Review URL: https://codereview.chromium.org/111843004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240564 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc8
-rw-r--r--ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc8
2 files changed, 10 insertions, 6 deletions
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 eda5b26..128f2b8 100644
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
@@ -335,12 +335,14 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) {
void SelectFileDialogImplGTK::FileSelected(GtkWidget* dialog,
const base::FilePath& path) {
- if (type_ == SELECT_SAVEAS_FILE)
+ if (type_ == SELECT_SAVEAS_FILE) {
*last_saved_path_ = path.DirName();
- else if (type_ == SELECT_OPEN_FILE || type_ == SELECT_FOLDER)
+ } else if (type_ == SELECT_OPEN_FILE || type_ == SELECT_FOLDER ||
+ type_ == SELECT_UPLOAD_FOLDER) {
*last_opened_path_ = path.DirName();
- else
+ } else {
NOTREACHED();
+ }
if (listener_) {
GtkFileFilter* selected_filter =
diff --git a/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc b/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc
index 66000dc..ecb97dc 100644
--- a/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc
+++ b/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc
@@ -291,12 +291,14 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) {
void SelectFileDialogImplGTK::FileSelected(GtkWidget* dialog,
const base::FilePath& path) {
- if (type_ == SELECT_SAVEAS_FILE)
+ if (type_ == SELECT_SAVEAS_FILE) {
*last_saved_path_ = path.DirName();
- else if (type_ == SELECT_OPEN_FILE || type_ == SELECT_FOLDER)
+ } else if (type_ == SELECT_OPEN_FILE || type_ == SELECT_FOLDER ||
+ type_ == SELECT_UPLOAD_FOLDER) {
*last_opened_path_ = path.DirName();
- else
+ } else {
NOTREACHED();
+ }
if (listener_) {
GtkFileFilter* selected_filter =