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 "config.h" | 5 #include "config.h" |
6 #include "web/RemoteFrameClientImpl.h" | 6 #include "web/RemoteFrameClientImpl.h" |
7 | 7 |
8 #include "core/events/KeyboardEvent.h" | 8 #include "core/events/KeyboardEvent.h" |
9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
10 #include "core/events/WheelEvent.h" | 10 #include "core/events/WheelEvent.h" |
11 #include "core/frame/RemoteFrame.h" | 11 #include "core/frame/RemoteFrame.h" |
12 #include "core/frame/RemoteFrameView.h" | 12 #include "core/frame/RemoteFrameView.h" |
13 #include "core/rendering/RenderPart.h" | 13 #include "core/rendering/RenderPart.h" |
14 #include "platform/exported/WrappedResourceRequest.h" | 14 #include "platform/exported/WrappedResourceRequest.h" |
15 #include "platform/weborigin/SecurityOrigin.h" | 15 #include "platform/weborigin/SecurityOrigin.h" |
16 #include "platform/weborigin/SecurityPolicy.h" | 16 #include "platform/weborigin/SecurityPolicy.h" |
| 17 #include "public/web/WebRemoteFrameClient.h" |
17 #include "web/WebInputEventConversion.h" | 18 #include "web/WebInputEventConversion.h" |
18 #include "web/WebLocalFrameImpl.h" | 19 #include "web/WebLocalFrameImpl.h" |
19 #include "web/WebRemoteFrameImpl.h" | 20 #include "web/WebRemoteFrameImpl.h" |
20 | 21 |
21 namespace blink { | 22 namespace blink { |
22 | 23 |
23 RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameImpl* webFrame) | 24 RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameImpl* webFrame) |
24 : m_webFrame(webFrame) | 25 : m_webFrame(webFrame) |
25 { | 26 { |
26 } | 27 } |
27 | 28 |
28 void RemoteFrameClientImpl::detached() | 29 void RemoteFrameClientImpl::detached() |
29 { | 30 { |
30 // FIXME: Implement. | 31 // Alert the client that the frame is being detached. |
| 32 RefPtrWillBeRawPtr<WebRemoteFrameImpl> protector(m_webFrame); |
| 33 |
| 34 WebRemoteFrameClient* client = m_webFrame->client(); |
| 35 if (!client) |
| 36 return; |
| 37 |
| 38 client->frameDetached(); |
| 39 // Clear our reference to RemoteFrame at the very end, in case the client |
| 40 // refers to it. |
| 41 m_webFrame->setCoreFrame(nullptr); |
31 } | 42 } |
32 | 43 |
33 Frame* RemoteFrameClientImpl::opener() const | 44 Frame* RemoteFrameClientImpl::opener() const |
34 { | 45 { |
35 return toCoreFrame(m_webFrame->opener()); | 46 return toCoreFrame(m_webFrame->opener()); |
36 } | 47 } |
37 | 48 |
38 void RemoteFrameClientImpl::setOpener(Frame*) | 49 void RemoteFrameClientImpl::setOpener(Frame*) |
39 { | 50 { |
40 // FIXME: Implement. | 51 // FIXME: Implement. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event
))); | 111 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event
))); |
101 | 112 |
102 // Other or internal Blink events should not be forwarded. | 113 // Other or internal Blink events should not be forwarded. |
103 if (!webEvent || webEvent->type == WebInputEvent::Undefined) | 114 if (!webEvent || webEvent->type == WebInputEvent::Undefined) |
104 return; | 115 return; |
105 | 116 |
106 m_webFrame->client()->forwardInputEvent(webEvent.get()); | 117 m_webFrame->client()->forwardInputEvent(webEvent.get()); |
107 } | 118 } |
108 | 119 |
109 } // namespace blink | 120 } // namespace blink |
OLD | NEW |