OLD | NEW |
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/renderer/render_frame_proxy.h" | 5 #include "content/renderer/render_frame_proxy.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/child/webmessageportchannel_impl.h" | 10 #include "content/child/webmessageportchannel_impl.h" |
11 #include "content/common/frame_messages.h" | 11 #include "content/common/frame_messages.h" |
12 #include "content/common/swapped_out_messages.h" | 12 #include "content/common/swapped_out_messages.h" |
13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
14 #include "content/renderer/child_frame_compositing_helper.h" | 14 #include "content/renderer/child_frame_compositing_helper.h" |
15 #include "content/renderer/render_frame_impl.h" | 15 #include "content/renderer/render_frame_impl.h" |
16 #include "content/renderer/render_thread_impl.h" | 16 #include "content/renderer/render_thread_impl.h" |
17 #include "content/renderer/render_view_impl.h" | 17 #include "content/renderer/render_view_impl.h" |
18 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 18 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 19 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
19 #include "third_party/WebKit/public/web/WebView.h" | 20 #include "third_party/WebKit/public/web/WebView.h" |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 | 23 |
23 namespace { | 24 namespace { |
24 | 25 |
25 // Facilitates lookup of RenderFrameProxy by routing_id. | 26 // Facilitates lookup of RenderFrameProxy by routing_id. |
26 typedef std::map<int, RenderFrameProxy*> RoutingIDProxyMap; | 27 typedef std::map<int, RenderFrameProxy*> RoutingIDProxyMap; |
27 static base::LazyInstance<RoutingIDProxyMap> g_routing_id_proxy_map = | 28 static base::LazyInstance<RoutingIDProxyMap> g_routing_id_proxy_map = |
28 LAZY_INSTANCE_INITIALIZER; | 29 LAZY_INSTANCE_INITIALIZER; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if (source_frame) { | 281 if (source_frame) { |
281 RenderViewImpl* source_view = | 282 RenderViewImpl* source_view = |
282 RenderViewImpl::FromWebView(source_frame->view()); | 283 RenderViewImpl::FromWebView(source_frame->view()); |
283 if (source_view) | 284 if (source_view) |
284 params.source_routing_id = source_view->routing_id(); | 285 params.source_routing_id = source_view->routing_id(); |
285 } | 286 } |
286 | 287 |
287 Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params)); | 288 Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params)); |
288 } | 289 } |
289 | 290 |
| 291 void RenderFrameProxy::navigate(blink::WebRemoteFrame* frame, |
| 292 const blink::WebURLRequest& request, |
| 293 bool should_replace_current_entry) { |
| 294 DCHECK_EQ(web_frame_, frame); |
| 295 |
| 296 FrameHostMsg_OpenURL_Params params; |
| 297 params.url = request.url(); |
| 298 params.referrer = Referrer( |
| 299 GURL(request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), |
| 300 request.referrerPolicy()); |
| 301 params.disposition = CURRENT_TAB; |
| 302 params.should_replace_current_entry = should_replace_current_entry; |
| 303 params.user_gesture = |
| 304 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 305 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 306 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 307 } |
| 308 |
290 } // namespace | 309 } // namespace |
OLD | NEW |