Fix issue 4898: File extension wrong for saved files
Fix issue 4898: File extension wrong for saved files

When the user specifies a filename without an extension, such as "foo" instead of "foo.gif", we would append "gif" to the filename instead of ".gif" (so the user ends up with a file named "foogif").

I'm not confident this is the only thing wrong with this function. For example if the user specifies "foo." and the filter says "*.gif" shouldn't we add ".gif" to the filename instead of deleting the dot?

Also, we seem to be ignoring the default_extension parameter passed in when we figure out what extension to tack on and instead get the file extension from GetFileExtensionFromPath... :s

Review URL: http://codereview.chromium.org/12838

git-svn-id: http://src.chromium.org/svn/trunk/src@6174 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 48b9b28a71c3c9c0211ce861d60aa6a1fcb43c35
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser