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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params)); | 272 Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params)); |
272 } | 273 } |
273 | 274 |
274 void RenderFrameProxy::initializeChildFrame( | 275 void RenderFrameProxy::initializeChildFrame( |
275 const blink::WebRect& frame_rect, | 276 const blink::WebRect& frame_rect, |
276 float scale_factor) { | 277 float scale_factor) { |
277 Send(new FrameHostMsg_InitializeChildFrame( | 278 Send(new FrameHostMsg_InitializeChildFrame( |
278 routing_id_, frame_rect, scale_factor)); | 279 routing_id_, frame_rect, scale_factor)); |
279 } | 280 } |
280 | 281 |
| 282 void RenderFrameProxy::navigate(const blink::WebURLRequest& request, |
| 283 bool should_replace_current_entry) { |
| 284 FrameHostMsg_OpenURL_Params params; |
| 285 params.url = request.url(); |
| 286 params.referrer = Referrer( |
| 287 GURL(request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), |
| 288 request.referrerPolicy()); |
| 289 params.disposition = CURRENT_TAB; |
| 290 params.should_replace_current_entry = should_replace_current_entry; |
| 291 params.user_gesture = |
| 292 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 293 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 294 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 295 } |
| 296 |
281 } // namespace | 297 } // namespace |
OLD | NEW |