Chromium Code Reviews| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 params->transition = entry.GetTransitionType(); | 208 params->transition = entry.GetTransitionType(); |
| 209 params->state = entry.GetContentState(); | 209 params->state = entry.GetContentState(); |
| 210 params->navigation_type = | 210 params->navigation_type = |
| 211 GetNavigationType(controller.GetBrowserContext(), entry, reload_type); | 211 GetNavigationType(controller.GetBrowserContext(), entry, reload_type); |
| 212 params->request_time = base::Time::Now(); | 212 params->request_time = base::Time::Now(); |
| 213 params->extra_headers = entry.extra_headers(); | 213 params->extra_headers = entry.extra_headers(); |
| 214 params->transferred_request_child_id = | 214 params->transferred_request_child_id = |
| 215 entry.transferred_global_request_id().child_id; | 215 entry.transferred_global_request_id().child_id; |
| 216 params->transferred_request_request_id = | 216 params->transferred_request_request_id = |
| 217 entry.transferred_global_request_id().request_id; | 217 entry.transferred_global_request_id().request_id; |
| 218 // We only want to allow downloading if "view-source:" is not pre-pended. | |
|
darin (slow to review)
2012/04/26 21:54:49
nit: no need to repeat the code so precisely in th
| |
| 219 params->allow_download = | |
| 220 !entry.GetVirtualURL().SchemeIs(chrome::kViewSourceScheme); | |
| 218 | 221 |
| 219 if (delegate) | 222 if (delegate) |
| 220 delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers); | 223 delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers); |
| 221 } | 224 } |
| 222 | 225 |
| 223 } // namespace | 226 } // namespace |
| 224 | 227 |
| 225 namespace content { | 228 namespace content { |
| 226 | 229 |
| 227 WebContents* WebContents::Create( | 230 WebContents* WebContents::Create( |
| (...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2622 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2625 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2623 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2626 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2624 // Can be NULL during tests. | 2627 // Can be NULL during tests. |
| 2625 if (rwh_view) | 2628 if (rwh_view) |
| 2626 rwh_view->SetSize(GetView()->GetContainerSize()); | 2629 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2627 } | 2630 } |
| 2628 | 2631 |
| 2629 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2632 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2630 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2633 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2631 } | 2634 } |
| OLD | NEW |