Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 2aba4bcb91a3ec52f4d25e195000466ec695f8ed..c1675191c776098365196d037b6721bb4f495660 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -1209,7 +1209,7 @@ void WebContentsImpl::OnSavePage() { |
| if (!IsSavable()) { |
| download_stats::RecordDownloadSource( |
| download_stats::INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML); |
| - SaveURL(GetURL(), GURL(), true); |
| + SaveURL(GetURL(), content::Referrer(), true); |
| return; |
| } |
| @@ -1739,7 +1739,8 @@ void WebContentsImpl::OnUpdateZoomLimits(int minimum_percent, |
| temporary_zoom_settings_ = !remember; |
| } |
| -void WebContentsImpl::OnSaveURL(const GURL& url) { |
| +void WebContentsImpl::OnSaveURL(const GURL& url, |
| + const content::Referrer& referrer) { |
| download_stats::RecordDownloadSource( |
| download_stats::INITIATED_BY_PEPPER_SAVE); |
| // Check if the URL to save matches the URL of the main frame. Since this |
| @@ -1749,7 +1750,7 @@ void WebContentsImpl::OnSaveURL(const GURL& url) { |
| if (!main_frame_url.is_valid()) |
| return; |
| bool is_main_frame = (url == main_frame_url); |
| - SaveURL(url, main_frame_url, is_main_frame); |
| + SaveURL(url, referrer, is_main_frame); |
| } |
| void WebContentsImpl::OnEnumerateDirectory(int request_id, |
| @@ -2703,7 +2704,7 @@ void WebContentsImpl::SetEncoding(const std::string& encoding) { |
| } |
| void WebContentsImpl::SaveURL(const GURL& url, |
| - const GURL& referrer, |
| + const content::Referrer& referrer, |
| bool is_main_frame) { |
| DownloadManager* dlm = GetBrowserContext()->GetDownloadManager(); |
| if (!dlm) |
| @@ -2718,7 +2719,8 @@ void WebContentsImpl::SaveURL(const GURL& url, |
| save_info.prompt_for_save_location = true; |
| scoped_ptr<DownloadUrlParameters> params( |
| DownloadUrlParameters::FromWebContents(this, url, save_info)); |
| - params->set_referrer(referrer); |
| + // TODO(jochen): Pass in the referrer policy as well. |
|
benjhayden
2012/05/14 13:56:20
Any reason not to do this in this cl?
jochen (gone - plz use gerrit)
2012/05/14 14:11:22
Yes, because then I need to change all places that
|
| + params->set_referrer(referrer.url); |
| params->set_post_id(post_id); |
| params->set_prefer_cache(true); |
| if (post_id >= 0) |