Chromium Code Reviews| Index: chrome/browser/tab_contents/render_view_context_menu.cc |
| diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc |
| index 2c6d28f796c97b1baf1b215f1c516ecfdf11e6e4..6665e8ffaf49c3ca16d60f755fda39bdc2492798 100644 |
| --- a/chrome/browser/tab_contents/render_view_context_menu.cc |
| +++ b/chrome/browser/tab_contents/render_view_context_menu.cc |
| @@ -61,6 +61,7 @@ |
| #include "content/public/browser/child_process_security_policy.h" |
| #include "content/public/browser/download_manager.h" |
| #include "content/public/browser/download_save_info.h" |
| +#include "content/public/browser/download_url_parameters.h" |
| #include "content/public/browser/navigation_details.h" |
| #include "content/public/browser/navigation_entry.h" |
| #include "content/public/browser/notification_service.h" |
| @@ -85,8 +86,14 @@ |
| #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
| #endif |
| +using WebKit::WebContextMenuData; |
| +using WebKit::WebMediaPlayerAction; |
| +using WebKit::WebPluginAction; |
| +using WebKit::WebString; |
| +using WebKit::WebURL; |
|
Randy Smith (Not in Mondays)
2012/04/30 19:44:48
nit: Why does WebKit go first? It's not alphabeti
benjhayden
2012/05/02 15:11:54
'W'=87
'c'=99
Randy Smith (Not in Mondays)
2012/05/02 18:36:22
Very true :-}. Ok.
|
| using content::ChildProcessSecurityPolicy; |
| using content::DownloadManager; |
| +using content::DownloadUrlParameters; |
| using content::NavigationController; |
| using content::NavigationEntry; |
| using content::OpenURLParams; |
| @@ -94,11 +101,6 @@ using content::RenderViewHost; |
| using content::SSLStatus; |
| using content::UserMetricsAction; |
| using content::WebContents; |
| -using WebKit::WebContextMenuData; |
| -using WebKit::WebMediaPlayerAction; |
| -using WebKit::WebPluginAction; |
| -using WebKit::WebURL; |
| -using WebKit::WebString; |
| namespace { |
| @@ -1510,14 +1512,11 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { |
| save_info.prompt_for_save_location = true; |
| DownloadManager* dlm = |
| DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); |
| - dlm->DownloadUrl(url, |
| - referrer, |
| - params_.frame_charset, |
| - false, // Don't prefer_cache |
| - -1, // No POST id |
| - save_info, |
| - source_web_contents_, |
| - DownloadManager::OnStartedCallback()); |
| + DownloadUrlParameters* dl_params = DownloadUrlParameters::FromWebContents( |
| + source_web_contents_, url, save_info); |
| + dl_params->set_referrer(referrer); |
| + dl_params->set_referrer_encoding(params_.frame_charset); |
| + dlm->DownloadUrl(dl_params); |
| break; |
| } |
| @@ -1539,14 +1538,12 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { |
| } |
| DownloadManager* dlm = |
| DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager(); |
| - dlm->DownloadUrl(url, |
| - referrer, |
| - "", |
| - true, // prefer_cache |
| - post_id, |
| - save_info, |
| - source_web_contents_, |
| - DownloadManager::OnStartedCallback()); |
| + DownloadUrlParameters* dl_params = DownloadUrlParameters::FromWebContents( |
| + source_web_contents_, url, save_info); |
| + dl_params->set_referrer(referrer); |
| + dl_params->set_post_id(post_id); |
| + dl_params->set_prefer_cache(true); |
| + dlm->DownloadUrl(dl_params); |
| break; |
| } |