OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Portions based heavily on: | 5 // Portions based heavily on: |
6 // third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.cpp | 6 // third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.cpp |
7 // | 7 // |
8 /* | 8 /* |
9 * Copyright (C) 2006-2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2006-2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // NOTE: ui::ScrollEvent instances come from the touchpad. | 155 // NOTE: ui::ScrollEvent instances come from the touchpad. |
156 WebKit::WebGestureEvent MakeWebGestureEventFromAuraEvent( | 156 WebKit::WebGestureEvent MakeWebGestureEventFromAuraEvent( |
157 ui::ScrollEvent* event) { | 157 ui::ScrollEvent* event) { |
158 WebKit::WebGestureEvent webkit_event; | 158 WebKit::WebGestureEvent webkit_event; |
159 | 159 |
160 switch (event->type()) { | 160 switch (event->type()) { |
161 case ui::ET_SCROLL_FLING_START: | 161 case ui::ET_SCROLL_FLING_START: |
162 webkit_event.type = WebKit::WebInputEvent::GestureFlingStart; | 162 webkit_event.type = WebKit::WebInputEvent::GestureFlingStart; |
163 webkit_event.data.flingStart.velocityX = event->x_offset(); | 163 webkit_event.data.flingStart.velocityX = event->x_offset(); |
164 webkit_event.data.flingStart.velocityY = event->y_offset(); | 164 webkit_event.data.flingStart.velocityY = event->y_offset(); |
165 // FIXME(mohsen || rjkroege): Remove following line after removing uses of | |
166 // flingStart.sourceDevice in WebKit, but before removing the field | |
167 // itself. | |
168 webkit_event.data.flingStart.sourceDevice = | |
169 WebKit::WebGestureEvent::Touchpad; | |
170 break; | 165 break; |
171 case ui::ET_SCROLL_FLING_CANCEL: | 166 case ui::ET_SCROLL_FLING_CANCEL: |
172 webkit_event.type = WebKit::WebInputEvent::GestureFlingCancel; | 167 webkit_event.type = WebKit::WebInputEvent::GestureFlingCancel; |
173 break; | 168 break; |
174 case ui::ET_SCROLL: | 169 case ui::ET_SCROLL: |
175 NOTREACHED() << "Invalid gesture type: " << event->type(); | 170 NOTREACHED() << "Invalid gesture type: " << event->type(); |
176 break; | 171 break; |
177 default: | 172 default: |
178 NOTREACHED() << "Unknown gesture type: " << event->type(); | 173 NOTREACHED() << "Unknown gesture type: " << event->type(); |
179 } | 174 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 222 } |
228 | 223 |
229 webkit_event.setKeyIdentifierFromWindowsKeyCode(); | 224 webkit_event.setKeyIdentifierFromWindowsKeyCode(); |
230 | 225 |
231 // TODO: IsAutoRepeat/IsKeyPad? | 226 // TODO: IsAutoRepeat/IsKeyPad? |
232 | 227 |
233 return webkit_event; | 228 return webkit_event; |
234 } | 229 } |
235 | 230 |
236 } // namespace content | 231 } // namespace content |
OLD | NEW |