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

Unified Diff: ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc

Issue 10697010: Make saving files from flash less annoying. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/base/dialogs/gtk/select_file_dialog_impl_gtk.cc
===================================================================
--- ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc (revision 151539)
+++ ui/base/dialogs/gtk/select_file_dialog_impl_gtk.cc (working copy)
@@ -403,10 +403,16 @@
// Since the file may not already exist, we use
// set_current_folder() followed by set_current_name(), as per the
// recommendation of the GTK docs.
- gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
- default_path.DirName().value().c_str());
- gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog),
- default_path.BaseName().value().c_str());
+ if (CallDirectoryExistsOnUIThread(default_path)) {
+ gtk_file_chooser_set_current_folder(
+ GTK_FILE_CHOOSER(dialog), default_path.value().c_str());
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "");
+ } else {
+ gtk_file_chooser_set_current_folder(
+ GTK_FILE_CHOOSER(dialog), default_path.DirName().value().c_str());
+ gtk_file_chooser_set_current_name(
+ GTK_FILE_CHOOSER(dialog), default_path.BaseName().value().c_str());
+ }
} else if (!last_saved_path_->empty()) {
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
last_saved_path_->value().c_str());

Powered by Google App Engine
This is Rietveld 408576698