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" | |
9 #include "core/events/MouseEvent.h" | |
10 #include "core/events/WheelEvent.h" | |
11 #include "core/frame/RemoteFrame.h" | |
12 #include "core/frame/RemoteFrameView.h" | |
13 #include "core/rendering/RenderPart.h" | |
8 #include "platform/exported/WrappedResourceRequest.h" | 14 #include "platform/exported/WrappedResourceRequest.h" |
9 #include "platform/weborigin/SecurityOrigin.h" | 15 #include "platform/weborigin/SecurityOrigin.h" |
10 #include "platform/weborigin/SecurityPolicy.h" | 16 #include "platform/weborigin/SecurityPolicy.h" |
17 #include "web/WebInputEventConversion.h" | |
11 #include "web/WebLocalFrameImpl.h" | 18 #include "web/WebLocalFrameImpl.h" |
12 #include "web/WebRemoteFrameImpl.h" | 19 #include "web/WebRemoteFrameImpl.h" |
13 | 20 |
14 namespace blink { | 21 namespace blink { |
15 | 22 |
16 RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameImpl* webFrame) | 23 RemoteFrameClientImpl::RemoteFrameClientImpl(WebRemoteFrameImpl* webFrame) |
17 : m_webFrame(webFrame) | 24 : m_webFrame(webFrame) |
18 { | 25 { |
19 } | 26 } |
20 | 27 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 m_webFrame->client()->postMessageEvent(WebLocalFrameImpl::fromFrame(sour ceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event)); | 77 m_webFrame->client()->postMessageEvent(WebLocalFrameImpl::fromFrame(sour ceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event)); |
71 return true; | 78 return true; |
72 } | 79 } |
73 | 80 |
74 void RemoteFrameClientImpl::navigate(const ResourceRequest& request, bool should ReplaceCurrentEntry) | 81 void RemoteFrameClientImpl::navigate(const ResourceRequest& request, bool should ReplaceCurrentEntry) |
75 { | 82 { |
76 if (m_webFrame->client()) | 83 if (m_webFrame->client()) |
77 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe placeCurrentEntry); | 84 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe placeCurrentEntry); |
78 } | 85 } |
79 | 86 |
87 // FIXME: Remove this code once we have input routing in the browser | |
88 // process. See http://crbug.com/339659. | |
89 void RemoteFrameClientImpl::forwardInputEvent(Event* event) | |
90 { | |
91 // This is only called when we have out-of-process iframes, which | |
92 // need to forward input events across processes. | |
Nate Chapin
2014/10/16 19:18:43
This comment doesn't add much, given that it lives
Charlie Reis
2014/10/16 20:09:02
Actually, we likely will have RemoteFrames in defa
Nate Chapin
2014/10/16 20:14:45
Fair enough.
| |
93 // FIXME: Add a check for out-of-process iframes enabled. | |
94 if (event->isKeyboardEvent()) { | |
95 WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event)); | |
96 m_webFrame->client()->forwardInputEvent(&webEvent); | |
97 } else if (event->isMouseEvent()) { | |
98 WebMouseEventBuilder webEvent(m_webFrame->frame()->view(), toCoreFrame(m _webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event)); | |
99 // Internal Blink events should not be forwarded. | |
100 if (webEvent.type == WebInputEvent::Undefined) | |
101 return; | |
102 m_webFrame->client()->forwardInputEvent(&webEvent); | |
103 } else if (event->isWheelEvent()) { | |
104 WebMouseWheelEventBuilder webEvent(m_webFrame->frame()->view(), toCoreFr ame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event)); | |
105 if (webEvent.type == WebInputEvent::Undefined) | |
106 return; | |
107 m_webFrame->client()->forwardInputEvent(&webEvent); | |
Nate Chapin
2014/10/16 19:18:43
Would it be cleaner to define webEvent outside the
Charlie Reis
2014/10/16 20:09:02
Done.
| |
108 } | |
109 } | |
110 | |
80 } // namespace blink | 111 } // namespace blink |
OLD | NEW |