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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/web/RemoteFrameClientImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
93 // FIXME: Add a check for out-of-process iframes enabled.
94 OwnPtr<WebInputEvent> webEvent;
95 if (event->isKeyboardEvent())
96 webEvent = adoptPtr(new WebKeyboardEventBuilder(*static_cast<KeyboardEve nt*>(event)));
97 else if (event->isMouseEvent())
98 webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view() , toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event)));
99 else if (event->isWheelEvent())
100 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v iew(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event )));
101
102 // Other or internal Blink events should not be forwarded.
103 if (!webEvent || webEvent->type == WebInputEvent::Undefined)
104 return;
105
106 m_webFrame->client()->forwardInputEvent(webEvent.get());
107 }
108
80 } // namespace blink 109 } // namespace blink
OLDNEW
« 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