| 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/frame_replication_state.h" | 12 #include "content/common/frame_replication_state.h" |
| 13 #include "content/common/swapped_out_messages.h" | 13 #include "content/common/swapped_out_messages.h" |
| 14 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
| 15 #include "content/renderer/child_frame_compositing_helper.h" | 15 #include "content/renderer/child_frame_compositing_helper.h" |
| 16 #include "content/renderer/render_frame_impl.h" | 16 #include "content/renderer/render_frame_impl.h" |
| 17 #include "content/renderer/render_thread_impl.h" | 17 #include "content/renderer/render_thread_impl.h" |
| 18 #include "content/renderer/render_view_impl.h" | 18 #include "content/renderer/render_view_impl.h" |
| 19 #include "third_party/WebKit/public/platform/WebString.h" | 19 #include "third_party/WebKit/public/platform/WebString.h" |
| 20 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 20 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 21 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 21 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 22 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 22 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 // Facilitates lookup of RenderFrameProxy by routing_id. | 29 // Facilitates lookup of RenderFrameProxy by routing_id. |
| 29 typedef std::map<int, RenderFrameProxy*> RoutingIDProxyMap; | 30 typedef std::map<int, RenderFrameProxy*> RoutingIDProxyMap; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 304 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { |
| 304 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 305 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
| 305 } | 306 } |
| 306 | 307 |
| 307 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 308 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 308 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 309 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 309 blink::WebString::fromUTF8(origin.string()))); | 310 blink::WebString::fromUTF8(origin.string()))); |
| 310 } | 311 } |
| 311 | 312 |
| 312 void RenderFrameProxy::frameDetached() { | 313 void RenderFrameProxy::frameDetached() { |
| 313 if (web_frame_->parent()) { | 314 frameDetached(blink::WebDetachReason::Remove); |
| 315 } |
| 316 |
| 317 void RenderFrameProxy::frameDetached(blink::WebDetachReason reason) { |
| 318 if (reason == blink::WebDetachReason::Remove && web_frame_->parent()) { |
| 314 web_frame_->parent()->removeChild(web_frame_); | 319 web_frame_->parent()->removeChild(web_frame_); |
| 315 | 320 |
| 316 // Let the browser process know this subframe is removed, so that it is | 321 // Let the browser process know this subframe is removed, so that it is |
| 317 // destroyed in its current process. | 322 // destroyed in its current process. |
| 318 Send(new FrameHostMsg_Detach(routing_id_)); | 323 Send(new FrameHostMsg_Detach(routing_id_)); |
| 319 } | 324 } |
| 320 | 325 |
| 321 web_frame_->close(); | 326 web_frame_->close(); |
| 322 | 327 |
| 323 // Remove the entry in the WebFrame->RenderFrameProxy map, as the |web_frame_| | 328 // Remove the entry in the WebFrame->RenderFrameProxy map, as the |web_frame_| |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 389 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 385 blink::WebUserGestureIndicator::consumeUserGesture(); | 390 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 386 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 391 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 387 } | 392 } |
| 388 | 393 |
| 389 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 394 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 390 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 395 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 391 } | 396 } |
| 392 | 397 |
| 393 } // namespace | 398 } // namespace |
| OLD | NEW |