Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: Source/web/RemoteFrameClientImpl.cpp

Issue 642823006: Move forwardInputEvent to RemoteFrameClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix review comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/RemoteFrameClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/RemoteFrameClientImpl.cpp
diff --git a/Source/web/RemoteFrameClientImpl.cpp b/Source/web/RemoteFrameClientImpl.cpp
index 5d14cf5f96fb200fb4607b1d68f216143bca995e..dd1664f42dcb24740ae6c9d26338b77812a243af 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,26 @@ 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.
+ // FIXME: Add a check for out-of-process iframes enabled.
+ OwnPtr<WebInputEvent> webEvent;
+ if (event->isKeyboardEvent())
+ webEvent = adoptPtr(new WebKeyboardEventBuilder(*static_cast<KeyboardEvent*>(event)));
+ else if (event->isMouseEvent())
+ webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event)));
+ else if (event->isWheelEvent())
+ webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->view(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event)));
+
+ // Other or internal Blink events should not be forwarded.
+ if (!webEvent || webEvent->type == WebInputEvent::Undefined)
+ return;
+
+ m_webFrame->client()->forwardInputEvent(webEvent.get());
+}
+
} // namespace blink
« no previous file with comments | « Source/web/RemoteFrameClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698