diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 23:59:17 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 23:59:17 +0000 |
commit | 35f13ab63b056a8e36c06e41655684915c183701 (patch) | |
tree | 913426da932aa18f73f44950d50b1de0398c3968 /chrome_frame/utils.cc | |
parent | d65f129bee77d3a4f6ac186641fe11fd890ef077 (diff) | |
download | chromium_src-35f13ab63b056a8e36c06e41655684915c183701.zip chromium_src-35f13ab63b056a8e36c06e41655684915c183701.tar.gz chromium_src-35f13ab63b056a8e36c06e41655684915c183701.tar.bz2 |
Handle right-click->"Save Link As" in the host browser.
TEST=Right click on a link in CF and select "save link as". You should immediately get the host browser's download UI. Before there could be a significant wait before this happened.
BUG=23561
Review URL: http://codereview.chromium.org/506042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index be955bf..88b46c5 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -415,6 +415,25 @@ bool IsIEInPrivate() { return incognito_mode; } +HRESULT DoFileDownloadInIE(const wchar_t* url) { + DCHECK(url); + + HMODULE mod = ::GetModuleHandleA("ieframe.dll"); + if (!mod) + mod = ::GetModuleHandleA("shdocvw.dll"); + + if (!mod) { + NOTREACHED(); + return E_UNEXPECTED; + } + + typedef HRESULT (WINAPI* DoFileDownloadFn)(const wchar_t*); + DoFileDownloadFn fn = reinterpret_cast<DoFileDownloadFn>( + ::GetProcAddress(mod, "DoFileDownload")); + DCHECK(fn); + return fn ? fn(url) : E_UNEXPECTED; +} + bool GetModuleVersion(HMODULE module, uint32* high, uint32* low) { DCHECK(module != NULL) << "Please use GetModuleHandle(NULL) to get the process name"; |