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: de016e52bd170d2d4f2344f9bf92d50478b649e0@6174 0039d316-1c4b-4281-b951-d872f2087c98

adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,adobe/chromium,ropik/chromium,ropik/chromium,adobe/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium