| 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" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 325 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { |
| 326 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 326 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 329 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 330 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 330 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 331 blink::WebString::fromUTF8(origin.string()))); | 331 blink::WebString::fromUTF8(origin.string()))); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void RenderFrameProxy::frameDetached() { | 334 void RenderFrameProxy::frameDetached() { |
| 335 if (web_frame_->parent()) { | 335 frameDetached(DetachType::Remove); |
| 336 } |
| 337 |
| 338 void RenderFrameProxy::frameDetached(DetachType type) { |
| 339 if (type == DetachType::Remove && web_frame_->parent()) { |
| 336 web_frame_->parent()->removeChild(web_frame_); | 340 web_frame_->parent()->removeChild(web_frame_); |
| 337 | 341 |
| 338 // Let the browser process know this subframe is removed, so that it is | 342 // Let the browser process know this subframe is removed, so that it is |
| 339 // destroyed in its current process. | 343 // destroyed in its current process. |
| 340 Send(new FrameHostMsg_Detach(routing_id_)); | 344 Send(new FrameHostMsg_Detach(routing_id_)); |
| 341 } | 345 } |
| 342 | 346 |
| 343 web_frame_->close(); | 347 web_frame_->close(); |
| 344 | 348 |
| 345 // Remove the entry in the WebFrame->RenderFrameProxy map, as the |web_frame_| | 349 // 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... |
| 406 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 410 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 407 blink::WebUserGestureIndicator::consumeUserGesture(); | 411 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 408 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 412 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 409 } | 413 } |
| 410 | 414 |
| 411 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 415 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 412 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 416 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 413 } | 417 } |
| 414 | 418 |
| 415 } // namespace | 419 } // namespace |
| OLD | NEW |