OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 void RenderFrameImpl::OpenURL(WebFrame* frame, | 2557 void RenderFrameImpl::OpenURL(WebFrame* frame, |
2558 const GURL& url, | 2558 const GURL& url, |
2559 const Referrer& referrer, | 2559 const Referrer& referrer, |
2560 WebNavigationPolicy policy) { | 2560 WebNavigationPolicy policy) { |
2561 DCHECK_EQ(frame_, frame); | 2561 DCHECK_EQ(frame_, frame); |
2562 | 2562 |
2563 FrameHostMsg_OpenURL_Params params; | 2563 FrameHostMsg_OpenURL_Params params; |
2564 params.url = url; | 2564 params.url = url; |
2565 params.referrer = referrer; | 2565 params.referrer = referrer; |
2566 params.disposition = RenderViewImpl::NavigationPolicyToDisposition(policy); | 2566 params.disposition = RenderViewImpl::NavigationPolicyToDisposition(policy); |
2567 params.frame_id = RenderFrameImpl::FromWebFrame(frame)->GetRoutingID(); | |
2568 WebDataSource* ds = frame->provisionalDataSource(); | 2567 WebDataSource* ds = frame->provisionalDataSource(); |
2569 if (ds) { | 2568 if (ds) { |
2570 DocumentState* document_state = DocumentState::FromDataSource(ds); | 2569 DocumentState* document_state = DocumentState::FromDataSource(ds); |
2571 NavigationState* navigation_state = document_state->navigation_state(); | 2570 NavigationState* navigation_state = document_state->navigation_state(); |
2572 if (navigation_state->is_content_initiated()) { | 2571 if (navigation_state->is_content_initiated()) { |
2573 params.should_replace_current_entry = ds->replacesCurrentHistoryItem(); | 2572 params.should_replace_current_entry = ds->replacesCurrentHistoryItem(); |
2574 } else { | 2573 } else { |
2575 // This is necessary to preserve the should_replace_current_entry value on | 2574 // This is necessary to preserve the should_replace_current_entry value on |
2576 // cross-process redirects, in the event it was set by a previous process. | 2575 // cross-process redirects, in the event it was set by a previous process. |
2577 // | 2576 // |
(...skipping 13 matching lines...) Expand all Loading... |
2591 policy == blink::WebNavigationPolicyNewForegroundTab || | 2590 policy == blink::WebNavigationPolicyNewForegroundTab || |
2592 policy == blink::WebNavigationPolicyNewWindow || | 2591 policy == blink::WebNavigationPolicyNewWindow || |
2593 policy == blink::WebNavigationPolicyNewPopup) { | 2592 policy == blink::WebNavigationPolicyNewPopup) { |
2594 WebUserGestureIndicator::consumeUserGesture(); | 2593 WebUserGestureIndicator::consumeUserGesture(); |
2595 } | 2594 } |
2596 | 2595 |
2597 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 2596 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
2598 } | 2597 } |
2599 | 2598 |
2600 } // namespace content | 2599 } // namespace content |
OLD | NEW |