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/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 3341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3352 DownloadManager* dlm = | 3352 DownloadManager* dlm = |
3353 BrowserContext::GetDownloadManager(GetBrowserContext()); | 3353 BrowserContext::GetDownloadManager(GetBrowserContext()); |
3354 if (!dlm) | 3354 if (!dlm) |
3355 return; | 3355 return; |
3356 int64 post_id = -1; | 3356 int64 post_id = -1; |
3357 if (is_main_frame) { | 3357 if (is_main_frame) { |
3358 const NavigationEntry* entry = controller_.GetActiveEntry(); | 3358 const NavigationEntry* entry = controller_.GetActiveEntry(); |
3359 if (entry) | 3359 if (entry) |
3360 post_id = entry->GetPostID(); | 3360 post_id = entry->GetPostID(); |
3361 } | 3361 } |
3362 content::DownloadSaveInfo save_info; | 3362 scoped_ptr<content::DownloadSaveInfo> save_info( |
3363 save_info.prompt_for_save_location = true; | 3363 new content::DownloadSaveInfo()); |
| 3364 save_info->prompt_for_save_location = true; |
3364 scoped_ptr<DownloadUrlParameters> params( | 3365 scoped_ptr<DownloadUrlParameters> params( |
3365 DownloadUrlParameters::FromWebContents(this, url, save_info)); | 3366 DownloadUrlParameters::FromWebContents(this, url, save_info.Pass())); |
3366 params->set_referrer(referrer); | 3367 params->set_referrer(referrer); |
3367 params->set_post_id(post_id); | 3368 params->set_post_id(post_id); |
3368 params->set_prefer_cache(true); | 3369 params->set_prefer_cache(true); |
3369 if (post_id >= 0) | 3370 if (post_id >= 0) |
3370 params->set_method("POST"); | 3371 params->set_method("POST"); |
3371 dlm->DownloadUrl(params.Pass()); | 3372 dlm->DownloadUrl(params.Pass()); |
3372 } | 3373 } |
3373 | 3374 |
3374 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3375 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
3375 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 3376 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
(...skipping 22 matching lines...) Expand all Loading... |
3398 } | 3399 } |
3399 } | 3400 } |
3400 | 3401 |
3401 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3402 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3402 return browser_plugin_guest_.get(); | 3403 return browser_plugin_guest_.get(); |
3403 } | 3404 } |
3404 | 3405 |
3405 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3406 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3406 return browser_plugin_embedder_.get(); | 3407 return browser_plugin_embedder_.get(); |
3407 } | 3408 } |
OLD | NEW |