Index: Source/web/RemoteFrameClientImpl.cpp |
diff --git a/Source/web/RemoteFrameClientImpl.cpp b/Source/web/RemoteFrameClientImpl.cpp |
index 5d14cf5f96fb200fb4607b1d68f216143bca995e..8bd21f1bcce47cf1fb50238f2b728c81793a211a 100644 |
--- a/Source/web/RemoteFrameClientImpl.cpp |
+++ b/Source/web/RemoteFrameClientImpl.cpp |
@@ -5,9 +5,16 @@ |
#include "config.h" |
#include "web/RemoteFrameClientImpl.h" |
+#include "core/events/KeyboardEvent.h" |
+#include "core/events/MouseEvent.h" |
+#include "core/events/WheelEvent.h" |
+#include "core/frame/RemoteFrame.h" |
+#include "core/frame/RemoteFrameView.h" |
+#include "core/rendering/RenderPart.h" |
#include "platform/exported/WrappedResourceRequest.h" |
#include "platform/weborigin/SecurityOrigin.h" |
#include "platform/weborigin/SecurityPolicy.h" |
+#include "web/WebInputEventConversion.h" |
#include "web/WebLocalFrameImpl.h" |
#include "web/WebRemoteFrameImpl.h" |
@@ -77,4 +84,28 @@ void RemoteFrameClientImpl::navigate(const ResourceRequest& request, bool should |
m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldReplaceCurrentEntry); |
} |
+// FIXME: Remove this code once we have input routing in the browser |
+// process. See http://crbug.com/339659. |
+void RemoteFrameClientImpl::forwardInputEvent(Event* event) |
+{ |
+ // This is only called when we have out-of-process iframes, which |
+ // 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.
|
+ // FIXME: Add a check for out-of-process iframes enabled. |
+ if (event->isKeyboardEvent()) { |
+ WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event)); |
+ m_webFrame->client()->forwardInputEvent(&webEvent); |
+ } else if (event->isMouseEvent()) { |
+ WebMouseEventBuilder webEvent(m_webFrame->frame()->view(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event)); |
+ // Internal Blink events should not be forwarded. |
+ if (webEvent.type == WebInputEvent::Undefined) |
+ return; |
+ m_webFrame->client()->forwardInputEvent(&webEvent); |
+ } else if (event->isWheelEvent()) { |
+ WebMouseWheelEventBuilder webEvent(m_webFrame->frame()->view(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event)); |
+ if (webEvent.type == WebInputEvent::Undefined) |
+ return; |
+ 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.
|
+ } |
+} |
+ |
} // namespace blink |