OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 webkit_event.modifiers = XStateToWebEventModifiers(native_key_event->state); | 308 webkit_event.modifiers = XStateToWebEventModifiers(native_key_event->state); |
309 | 309 |
310 switch (native_event->type) { | 310 switch (native_event->type) { |
311 case KeyPress: | 311 case KeyPress: |
312 webkit_event.type = event->is_char() ? WebKit::WebInputEvent::Char : | 312 webkit_event.type = event->is_char() ? WebKit::WebInputEvent::Char : |
313 WebKit::WebInputEvent::RawKeyDown; | 313 WebKit::WebInputEvent::RawKeyDown; |
314 break; | 314 break; |
315 case KeyRelease: | 315 case KeyRelease: |
316 webkit_event.type = WebKit::WebInputEvent::KeyUp; | 316 webkit_event.type = WebKit::WebInputEvent::KeyUp; |
317 break; | 317 break; |
318 case GenericEvent: | |
319 // TODO(sadrul): touch! | |
320 break; | |
321 default: | 318 default: |
322 NOTREACHED(); | 319 NOTREACHED(); |
323 } | 320 } |
324 | 321 |
325 if (webkit_event.modifiers & WebKit::WebInputEvent::AltKey) | 322 if (webkit_event.modifiers & WebKit::WebInputEvent::AltKey) |
326 webkit_event.isSystemKey = true; | 323 webkit_event.isSystemKey = true; |
327 | 324 |
328 webkit_event.windowsKeyCode = XKeyEventToWindowsKeyCode(native_key_event); | 325 webkit_event.windowsKeyCode = XKeyEventToWindowsKeyCode(native_key_event); |
329 webkit_event.nativeKeyCode = native_key_event->keycode; | 326 webkit_event.nativeKeyCode = native_key_event->keycode; |
330 | 327 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 409 } |
413 | 410 |
414 // Update the type of the touch event. | 411 // Update the type of the touch event. |
415 web_event->type = TouchEventTypeFromEvent(event); | 412 web_event->type = TouchEventTypeFromEvent(event); |
416 web_event->timeStampSeconds = event->time_stamp().ToDoubleT(); | 413 web_event->timeStampSeconds = event->time_stamp().ToDoubleT(); |
417 | 414 |
418 return point; | 415 return point; |
419 } | 416 } |
420 | 417 |
421 } // namespace content | 418 } // namespace content |
OLD | NEW |