From 39a248b002d0f41ad816754bb2833eea0aff9c61 Mon Sep 17 00:00:00 2001 From: "sky@google.com" Date: Wed, 12 Nov 2008 22:10:20 +0000 Subject: Adds the ability for save dialogs to take a default extension. BUG=4287 TEST=see bug Review URL: http://codereview.chromium.org/10621 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5304 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/win_util.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'chrome/common/win_util.h') diff --git a/chrome/common/win_util.h b/chrome/common/win_util.h index 6688892..5b0fc58 100644 --- a/chrome/common/win_util.h +++ b/chrome/common/win_util.h @@ -125,6 +125,8 @@ bool OpenItemViaShellNoZoneCheck(const std::wstring& full_path, // Returns 'true' on successful open, 'false' otherwise. bool OpenItemWithExternalApp(const std::wstring& full_path); +std::wstring GetFileFilterFromPath(const std::wstring& file_name); + // Prompt the user for location to save a file. 'suggested_name' is a full path // that gives the dialog box a hint as to how to initialize itself. // For example, a 'suggested_name' of: @@ -149,9 +151,12 @@ bool SaveFileAs(HWND owner, // The parameter |index| indicates the initial index of filter description // and filter pattern for the dialog box. If |index| is zero or greater than // the number of total filter types, the system uses the first filter in the -// |filter| buffer. The parameter |final_name| returns the file name which -// contains the drive designator, path, file name, and extension of the user -// selected file name. +// |filter| buffer. |index| is used to specify the initial selected extension, +// and when done contains the extension the user chose. The parameter +// |final_name| returns the file name which contains the drive designator, +// path, file name, and extension of the user selected file name. |def_ext| is +// the default extension to give to the file if the user did not enter an +// extension. bool SaveFileAsWithFilter(HWND owner, const std::wstring& suggested_name, const wchar_t* filter, -- cgit v1.1