diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-03 00:32:22 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-03 00:32:22 +0000 |
commit | 6cade219e58c8806bdbd02316d78f49c8fa97996 (patch) | |
tree | cd506501644bdb420f1dec4f705f79b0857f0795 /chrome/common/win_util.h | |
parent | cd7ef4f027ae36e80e368f967d1b98e1a3e3bde8 (diff) | |
download | chromium_src-6cade219e58c8806bdbd02316d78f49c8fa97996.zip chromium_src-6cade219e58c8806bdbd02316d78f49c8fa97996.tar.gz chromium_src-6cade219e58c8806bdbd02316d78f49c8fa97996.tar.bz2 |
Fix issue 4829: No file extensions listed when saving images
We were not supplying a filter list for the Save As dialog.
Now that we do, the user can select between, for example, say *.jpg and *.* as filters and we behave as follows:
With a *.jpg filter active, user enters foo and we save the file as: foo.jpg
With a *.jpg filter active, user enters foo. and we save the file as: foo..jpg (which is consistent with IE)
With a *.jpg filter active, user enters foo.jpg, we save the file as: foo.jpg
With a *.jpg filter active, user enters foo.jpeg, we save the file as: foo.jpeg (not foo.jpg or foo.jpeg.jpg)
With a *.* filter active, we respect whatever user enters as extension, except if the filename contains one or more trailing dots then we strip out all those trailing dots.
Also test filenames created when saving web pages, as opposed to images (should work as before).
Review URL: http://codereview.chromium.org/12836
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/win_util.h')
-rw-r--r-- | chrome/common/win_util.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/chrome/common/win_util.h b/chrome/common/win_util.h index 5b0fc58..030d48a 100644 --- a/chrome/common/win_util.h +++ b/chrome/common/win_util.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_WIN_UTIL_H__ -#define CHROME_COMMON_WIN_UTIL_H__ +#ifndef CHROME_COMMON_WIN_UTIL_H_ +#define CHROME_COMMON_WIN_UTIL_H_ #include <objbase.h> @@ -52,7 +52,7 @@ class CoMemReleaser { private: T* mem_ptr_; - DISALLOW_EVIL_CONSTRUCTORS(CoMemReleaser); + DISALLOW_COPY_AND_ASSIGN(CoMemReleaser); }; // Initializes COM in the constructor, and uninitializes COM in the @@ -68,7 +68,7 @@ class ScopedCOMInitializer { } private: - DISALLOW_EVIL_CONSTRUCTORS(ScopedCOMInitializer); + DISALLOW_COPY_AND_ASSIGN(ScopedCOMInitializer); }; // Creates a string interpretation of the time of day represented by the given @@ -159,7 +159,7 @@ bool SaveFileAs(HWND owner, // extension. bool SaveFileAsWithFilter(HWND owner, const std::wstring& suggested_name, - const wchar_t* filter, + const std::wstring& filter, const std::wstring& def_ext, unsigned* index, std::wstring* final_name); @@ -239,5 +239,4 @@ ChromeFont GetWindowTitleFont(); } // namespace win_util -#endif // WIN_COMMON_WIN_UTIL_H__ - +#endif // CHROME_COMMON_WIN_UTIL_H_ |