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

Side by Side Diff: chrome/browser/renderer_host/transfer_navigation_resource_handler.cc

Issue 8784006: Replace the GURL referrer field of OpenURLParams with a content::Referrer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/transfer_navigation_resource_handler.h" 5 #include "chrome/browser/renderer_host/transfer_navigation_resource_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/profiles/profile_io_data.h" 8 #include "chrome/browser/profiles/profile_io_data.h"
9 #include "chrome/browser/extensions/extension_info_map.h" 9 #include "chrome/browser/extensions/extension_info_map.h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
11 #include "content/browser/renderer_host/render_view_host_delegate.h" 11 #include "content/browser/renderer_host/render_view_host_delegate.h"
12 #include "content/browser/renderer_host/resource_dispatcher_host.h" 12 #include "content/browser/renderer_host/resource_dispatcher_host.h"
13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
14 #include "content/public/common/referrer.h"
14 15
15 namespace { 16 namespace {
16 17
17 // This code is borrowed from ChromeContentRendererClient. We want to mimic 18 // This code is borrowed from ChromeContentRendererClient. We want to mimic
18 // the logic used by the renderer. 19 // the logic used by the renderer.
19 // TODO(mpcomplete): move to common and share with the renderer logic. 20 // TODO(mpcomplete): move to common and share with the renderer logic.
20 // http://crbug.com/79520 21 // http://crbug.com/79520
21 const Extension* GetNonBookmarkAppExtension( 22 const Extension* GetNonBookmarkAppExtension(
22 const ExtensionSet& extensions, const GURL& url) { 23 const ExtensionSet& extensions, const GURL& url) {
23 // Exclude bookmark apps, which do not use the app process model. 24 // Exclude bookmark apps, which do not use the app process model.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const GlobalRequestID& request_id) { 59 const GlobalRequestID& request_id) {
59 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, 60 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id,
60 render_view_id); 61 render_view_id);
61 if (!rvh) 62 if (!rvh)
62 return; 63 return;
63 64
64 RenderViewHostDelegate* delegate = rvh->delegate(); 65 RenderViewHostDelegate* delegate = rvh->delegate();
65 if (!delegate) 66 if (!delegate)
66 return; 67 return;
67 68
68 delegate->RequestTransferURL(new_url, referrer, window_open_disposition, 69 delegate->RequestTransferURL(
69 frame_id, request_id); 70 new_url, content::Referrer(referrer, WebKit::WebReferrerPolicyDefault),
71 window_open_disposition, frame_id, request_id);
70 } 72 }
71 73
72 } // namespace 74 } // namespace
73 75
74 TransferNavigationResourceHandler::TransferNavigationResourceHandler( 76 TransferNavigationResourceHandler::TransferNavigationResourceHandler(
75 ResourceHandler* handler, 77 ResourceHandler* handler,
76 ResourceDispatcherHost* resource_dispatcher_host, 78 ResourceDispatcherHost* resource_dispatcher_host,
77 net::URLRequest* request) 79 net::URLRequest* request)
78 : next_handler_(handler), 80 : next_handler_(handler),
79 rdh_(resource_dispatcher_host), 81 rdh_(resource_dispatcher_host),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 bool TransferNavigationResourceHandler::OnResponseCompleted( 162 bool TransferNavigationResourceHandler::OnResponseCompleted(
161 int request_id, 163 int request_id,
162 const net::URLRequestStatus& status, 164 const net::URLRequestStatus& status,
163 const std::string& security_info) { 165 const std::string& security_info) {
164 return next_handler_->OnResponseCompleted(request_id, status, security_info); 166 return next_handler_->OnResponseCompleted(request_id, status, security_info);
165 } 167 }
166 168
167 void TransferNavigationResourceHandler::OnRequestClosed() { 169 void TransferNavigationResourceHandler::OnRequestClosed() {
168 next_handler_->OnRequestClosed(); 170 next_handler_->OnRequestClosed();
169 } 171 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_observer.cc ('k') | chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698