OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 DownloadManager* dlm = | 3369 DownloadManager* dlm = |
3370 BrowserContext::GetDownloadManager(GetBrowserContext()); | 3370 BrowserContext::GetDownloadManager(GetBrowserContext()); |
3371 if (!dlm) | 3371 if (!dlm) |
3372 return; | 3372 return; |
3373 int64 post_id = -1; | 3373 int64 post_id = -1; |
3374 if (is_main_frame) { | 3374 if (is_main_frame) { |
3375 const NavigationEntry* entry = controller_.GetActiveEntry(); | 3375 const NavigationEntry* entry = controller_.GetActiveEntry(); |
3376 if (entry) | 3376 if (entry) |
3377 post_id = entry->GetPostID(); | 3377 post_id = entry->GetPostID(); |
3378 } | 3378 } |
3379 content::DownloadSaveInfo save_info; | 3379 scoped_ptr<content::DownloadSaveInfo> save_info( |
3380 save_info.prompt_for_save_location = true; | 3380 new content::DownloadSaveInfo()); |
| 3381 save_info->prompt_for_save_location = true; |
3381 scoped_ptr<DownloadUrlParameters> params( | 3382 scoped_ptr<DownloadUrlParameters> params( |
3382 DownloadUrlParameters::FromWebContents(this, url, save_info)); | 3383 DownloadUrlParameters::FromWebContents(this, url, save_info.Pass())); |
3383 params->set_referrer(referrer); | 3384 params->set_referrer(referrer); |
3384 params->set_post_id(post_id); | 3385 params->set_post_id(post_id); |
3385 params->set_prefer_cache(true); | 3386 params->set_prefer_cache(true); |
3386 if (post_id >= 0) | 3387 if (post_id >= 0) |
3387 params->set_method("POST"); | 3388 params->set_method("POST"); |
3388 dlm->DownloadUrl(params.Pass()); | 3389 dlm->DownloadUrl(params.Pass()); |
3389 } | 3390 } |
3390 | 3391 |
3391 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3392 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
3392 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 3393 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
(...skipping 22 matching lines...) Expand all Loading... |
3415 } | 3416 } |
3416 } | 3417 } |
3417 | 3418 |
3418 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3419 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3419 return browser_plugin_guest_.get(); | 3420 return browser_plugin_guest_.get(); |
3420 } | 3421 } |
3421 | 3422 |
3422 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3423 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3423 return browser_plugin_embedder_.get(); | 3424 return browser_plugin_embedder_.get(); |
3424 } | 3425 } |
OLD | NEW |