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

Side by Side Diff: content/browser/frame_host/render_frame_proxy_host.cc

Issue 2355023002: Preserving Content-Type header from http request in OpenURL path. (Closed)
Patch Set: Filtering headers in PrerenderManager instead. Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/render_frame_proxy_host.h" 5 #include "content/browser/frame_host/render_frame_proxy_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/browser/bad_message.h" 10 #include "content/browser/bad_message.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 RenderFrameHostImpl* current_rfh = frame_tree_node_->current_frame_host(); 254 RenderFrameHostImpl* current_rfh = frame_tree_node_->current_frame_host();
255 if (!site_instance_->IsRelatedSiteInstance(current_rfh->GetSiteInstance())) 255 if (!site_instance_->IsRelatedSiteInstance(current_rfh->GetSiteInstance()))
256 return; 256 return;
257 257
258 // Since this navigation targeted a specific RenderFrameProxy, it should stay 258 // Since this navigation targeted a specific RenderFrameProxy, it should stay
259 // in the current tab. 259 // in the current tab.
260 DCHECK_EQ(WindowOpenDisposition::CURRENT_TAB, params.disposition); 260 DCHECK_EQ(WindowOpenDisposition::CURRENT_TAB, params.disposition);
261 261
262 // TODO(alexmos, creis): Figure out whether |params.user_gesture| needs to be 262 // TODO(alexmos, creis): Figure out whether |params.user_gesture| needs to be
263 // passed in as well. 263 // passed in as well.
264 // TODO(lfg, lukasza): Remove |extra_headers| parameter from
265 // RequestTransferURL method once both RenderFrameProxyHost and
266 // RenderFrameHostImpl call RequestOpenURL from their OnOpenURL handlers.
267 // See also https://crbug.com/647772.
264 frame_tree_node_->navigator()->RequestTransferURL( 268 frame_tree_node_->navigator()->RequestTransferURL(
265 current_rfh, validated_url, site_instance_.get(), std::vector<GURL>(), 269 current_rfh, validated_url, site_instance_.get(), std::vector<GURL>(),
266 params.referrer, ui::PAGE_TRANSITION_LINK, GlobalRequestID(), 270 params.referrer, ui::PAGE_TRANSITION_LINK, GlobalRequestID(),
267 params.should_replace_current_entry, params.uses_post ? "POST" : "GET", 271 params.should_replace_current_entry, params.uses_post ? "POST" : "GET",
268 params.resource_request_body); 272 params.resource_request_body, params.extra_headers);
269 } 273 }
270 274
271 void RenderFrameProxyHost::OnRouteMessageEvent( 275 void RenderFrameProxyHost::OnRouteMessageEvent(
272 const FrameMsg_PostMessage_Params& params) { 276 const FrameMsg_PostMessage_Params& params) {
273 RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host(); 277 RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host();
274 278
275 // Only deliver the message if the request came from a RenderFrameHost in the 279 // Only deliver the message if the request came from a RenderFrameHost in the
276 // same BrowsingInstance or if this WebContents is dedicated to a browser 280 // same BrowsingInstance or if this WebContents is dedicated to a browser
277 // plugin guest. 281 // plugin guest.
278 // 282 //
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type, 373 target_rfh->Send(new FrameMsg_AdvanceFocus(target_rfh->GetRoutingID(), type,
370 source_proxy_routing_id)); 374 source_proxy_routing_id));
371 } 375 }
372 376
373 void RenderFrameProxyHost::OnFrameFocused() { 377 void RenderFrameProxyHost::OnFrameFocused() {
374 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame( 378 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame(
375 frame_tree_node_, GetSiteInstance()); 379 frame_tree_node_, GetSiteInstance());
376 } 380 }
377 381
378 } // namespace content 382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698