From 4e9149ac6081cca4ed4898bc0a753603832dd100 Mon Sep 17 00:00:00 2001 From: "tsepez@chromium.org" Date: Wed, 15 Aug 2012 20:43:59 +0000 Subject: Make saving files from flash less annoying. Resolves missing or relative suggested paths relative to the last opened directory, and when the path is a directory itself, browse files under it rather than itself under its parent. Determining the latter takes a file system interrogation because the syntax isn't sufficient. BUG=140799 Review URL: https://chromiumcodereview.appspot.com/10697010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151738 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/file_select_helper.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'chrome/browser/file_select_helper.cc') diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc index 168ee9b..9ae5d57 100644 --- a/chrome/browser/file_select_helper.cc +++ b/chrome/browser/file_select_helper.cc @@ -401,9 +401,10 @@ void FileSelectHelper::RunFileChooserOnUIThread( dialog_type_ = ui::SelectFileDialog::SELECT_OPEN_FILE; NOTREACHED(); } - FilePath default_file_name = params.default_file_name; - if (default_file_name.empty()) - default_file_name = profile_->last_selected_directory(); + + FilePath default_file_name = params.default_file_name.IsAbsolute() ? + params.default_file_name : + profile_->last_selected_directory().Append(params.default_file_name); gfx::NativeWindow owning_window = platform_util::GetTopLevel(render_view_host_->GetView()->GetNativeView()); -- cgit v1.1