Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 9808029: Prepending view-source: does not load the source of the userscript. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: TabContents is now WebContentsImpl Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, &params->extra_headers); 223 delegate->AddNavigationHeaders(params->url, &params->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
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 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_impl.cc ('k') | content/common/request_extra_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698