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" | 8 #include "core/events/KeyboardEvent.h" |
9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
10 #include "core/events/WheelEvent.h" | 10 #include "core/events/WheelEvent.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // FIXME: Remove this code once we have input routing in the browser | 104 // FIXME: Remove this code once we have input routing in the browser |
105 // process. See http://crbug.com/339659. | 105 // process. See http://crbug.com/339659. |
106 void RemoteFrameClientImpl::forwardInputEvent(Event* event) | 106 void RemoteFrameClientImpl::forwardInputEvent(Event* event) |
107 { | 107 { |
108 // This is only called when we have out-of-process iframes, which | 108 // This is only called when we have out-of-process iframes, which |
109 // need to forward input events across processes. | 109 // need to forward input events across processes. |
110 // FIXME: Add a check for out-of-process iframes enabled. | 110 // FIXME: Add a check for out-of-process iframes enabled. |
111 OwnPtr<WebInputEvent> webEvent; | 111 OwnPtr<WebInputEvent> webEvent; |
112 if (event->isKeyboardEvent()) | 112 if (event->isKeyboardEvent()) |
113 webEvent = adoptPtr(new WebKeyboardEventBuilder(*static_cast<KeyboardEve
nt*>(event))); | 113 webEvent = adoptPtr(new WebKeyboardEventBuilder(m_webFrame->frame()->vie
w(), *static_cast<KeyboardEvent*>(event))); |
114 else if (event->isMouseEvent()) | 114 else if (event->isMouseEvent()) |
115 webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view()
, toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event))); | 115 webEvent = adoptPtr(new WebMouseEventBuilder(m_webFrame->frame()->view()
, toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<MouseEvent*>(event))); |
116 else if (event->isWheelEvent()) | 116 else if (event->isWheelEvent()) |
117 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event
))); | 117 webEvent = adoptPtr(new WebMouseWheelEventBuilder(m_webFrame->frame()->v
iew(), toCoreFrame(m_webFrame)->ownerRenderer(), *static_cast<WheelEvent*>(event
))); |
118 | 118 |
119 // Other or internal Blink events should not be forwarded. | 119 // Other or internal Blink events should not be forwarded. |
120 if (!webEvent || webEvent->type == WebInputEvent::Undefined) | 120 if (!webEvent || webEvent->type == WebInputEvent::Undefined) |
121 return; | 121 return; |
122 | 122 |
123 m_webFrame->client()->forwardInputEvent(webEvent.get()); | 123 m_webFrame->client()->forwardInputEvent(webEvent.get()); |
124 } | 124 } |
125 | 125 |
126 } // namespace blink | 126 } // namespace blink |
OLD | NEW |