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

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: Minor changes 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
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
« Source/core/html/HTMLFrameElementBase.cpp ('K') | « Source/web/RemoteFrameClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698