diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 19:57:24 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 19:57:24 +0000 |
commit | 15bc8050874dd8108a222e17e99344afcbe99a55 (patch) | |
tree | debfdefa16e4f4eb360f80f4e29461b0ec7f096f /chrome/browser/download/download_manager.cc | |
parent | 70a07ef6d9647d7b519638352cd17fa00ff22107 (diff) | |
download | chromium_src-15bc8050874dd8108a222e17e99344afcbe99a55.zip chromium_src-15bc8050874dd8108a222e17e99344afcbe99a55.tar.gz chromium_src-15bc8050874dd8108a222e17e99344afcbe99a55.tar.bz2 |
Fixes saving files that don't have valid extensions.
Two fixes here. First was a disturbing discovery that FilePath::Extension returns an extension starting with a period. I am of the belief that this is the wrong API to expose, but that's a different fight. Fixed.
Second is a subtle behavior of the old code that wasn't preserved. In the case where the extension did not exist in the registry, the old code dropped the extension from the filter. We now also do so.
BUG=10561
Review URL: http://codereview.chromium.org/79045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_manager.cc')
-rw-r--r-- | chrome/browser/download/download_manager.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 4e133e9..5a5649c 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -641,6 +641,8 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) { SelectFileDialog::FileTypeInfo file_type_info; file_type_info.extensions.resize(1); file_type_info.extensions[0].push_back(info->suggested_path.Extension()); + if (!file_type_info.extensions[0][0].empty()) + file_type_info.extensions[0][0].erase(0, 1); // drop the . file_type_info.include_all_files = true; gfx::NativeWindow owning_window = contents ? platform_util::GetTopLevel(contents->GetNativeView()) : NULL; |