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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 params->transition = entry.GetTransitionType(); | 212 params->transition = entry.GetTransitionType(); |
213 params->state = entry.GetContentState(); | 213 params->state = entry.GetContentState(); |
214 params->navigation_type = | 214 params->navigation_type = |
215 GetNavigationType(controller.GetBrowserContext(), entry, reload_type); | 215 GetNavigationType(controller.GetBrowserContext(), entry, reload_type); |
216 params->request_time = base::Time::Now(); | 216 params->request_time = base::Time::Now(); |
217 params->extra_headers = entry.extra_headers(); | 217 params->extra_headers = entry.extra_headers(); |
218 params->transferred_request_child_id = | 218 params->transferred_request_child_id = |
219 entry.transferred_global_request_id().child_id; | 219 entry.transferred_global_request_id().child_id; |
220 params->transferred_request_request_id = | 220 params->transferred_request_request_id = |
221 entry.transferred_global_request_id().request_id; | 221 entry.transferred_global_request_id().request_id; |
| 222 // Avoid downloading when in view-source mode. |
| 223 params->allow_download = !entry.IsViewSourceMode(); |
222 | 224 |
223 if (delegate) | 225 if (delegate) |
224 delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers); | 226 delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers); |
225 } | 227 } |
226 | 228 |
227 } // namespace | 229 } // namespace |
228 | 230 |
229 namespace content { | 231 namespace content { |
230 | 232 |
231 WebContents* WebContents::Create( | 233 WebContents* WebContents::Create( |
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2699 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2698 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2700 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2699 // Can be NULL during tests. | 2701 // Can be NULL during tests. |
2700 if (rwh_view) | 2702 if (rwh_view) |
2701 rwh_view->SetSize(GetView()->GetContainerSize()); | 2703 rwh_view->SetSize(GetView()->GetContainerSize()); |
2702 } | 2704 } |
2703 | 2705 |
2704 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2706 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
2705 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2707 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
2706 } | 2708 } |
OLD | NEW |