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/chrome_frame_activex_base.h | |
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/chrome_frame_activex_base.h')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 6a7183f..28ca868 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -40,6 +40,7 @@ #include "chrome_frame/com_message_event.h" #include "chrome_frame/com_type_info_holder.h" #include "chrome_frame/urlmon_url_request.h" +#include "grit/generated_resources.h" // Include without path to make GYP build see it. #include "chrome_tab.h" // NOLINT @@ -288,11 +289,26 @@ END_MSG_MAP() return CComControlBase::IOleObject_SetClientSite(client_site); } - bool HandleContextMenuCommand(UINT cmd) { + bool HandleContextMenuCommand(UINT cmd, + const IPC::ContextMenuParams& params) { if (cmd == IDC_ABOUT_CHROME_FRAME) { int tab_handle = automation_client_->tab()->handle(); OnOpenURL(tab_handle, GURL("about:version"), GURL(), NEW_WINDOW); return true; + } else { + switch (cmd) { + case IDS_CONTENT_CONTEXT_SAVEAUDIOAS: + case IDS_CONTENT_CONTEXT_SAVEVIDEOAS: + case IDS_CONTENT_CONTEXT_SAVEIMAGEAS: + case IDS_CONTENT_CONTEXT_SAVELINKAS: { + const GURL& referrer = params.frame_url.is_empty() ? + params.page_url : params.frame_url; + const GURL& url = (cmd == IDS_CONTENT_CONTEXT_SAVELINKAS ? + params.link_url : params.src_url); + DoFileDownloadInIE(UTF8ToWide(url.spec()).c_str()); + return true; + } + } } return false; |