OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains the definition for EventSendingController. | 5 // This file contains the definition for EventSendingController. |
6 // | 6 // |
7 // Some notes about drag and drop handling: | 7 // Some notes about drag and drop handling: |
8 // Windows drag and drop goes through a system call to DoDragDrop. At that | 8 // Windows drag and drop goes through a system call to DoDragDrop. At that |
9 // point, program control is given to Windows which then periodically makes | 9 // point, program control is given to Windows which then periodically makes |
10 // callbacks into the webview. This won't work for layout tests, so instead, | 10 // callbacks into the webview. This won't work for layout tests, so instead, |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 code = code_str[0]; | 375 code = code_str[0]; |
376 needs_shift_key_modifier = NeedsShiftModifer(code); | 376 needs_shift_key_modifier = NeedsShiftModifer(code); |
377 generate_char = true; | 377 generate_char = true; |
378 } | 378 } |
379 | 379 |
380 // NOTE(jnd):For one keydown event, we need to generate | 380 // NOTE(jnd):For one keydown event, we need to generate |
381 // keyDown/keyUp pair, refer EventSender.cpp in | 381 // keyDown/keyUp pair, refer EventSender.cpp in |
382 // WebKit/WebKitTools/DumpRenderTree/win. We may also need | 382 // WebKit/WebKitTools/DumpRenderTree/win. We may also need |
383 // to generate a keyChar event in certain cases. | 383 // to generate a keyChar event in certain cases. |
384 WebKeyboardEvent event_down, event_up; | 384 WebKeyboardEvent event_down, event_up; |
| 385 #if defined(OS_WIN) |
| 386 event_down.type = WebInputEvent::RAW_KEY_DOWN; |
| 387 #else |
385 event_down.type = WebInputEvent::KEY_DOWN; | 388 event_down.type = WebInputEvent::KEY_DOWN; |
| 389 #endif |
386 event_down.modifiers = 0; | 390 event_down.modifiers = 0; |
387 event_down.key_code = code; | 391 event_down.windows_key_code = code; |
388 #if defined(OS_LINUX) | 392 #if defined(OS_MAC) || defined(OS_LINUX) |
389 // TODO(deanm): This code is a confusing mix of different platform key | 393 // TODO(deanm): This code is a confusing mix of different platform key |
390 // codes. Since we're not working with a GDK event, we can't use our | 394 // codes. Since we're not working with a GDK event, we can't use our |
391 // GDK -> WebKit converter, which means the Linux specific extra |text| | 395 // GDK -> WebKit converter, which means the Linux specific extra |text| |
392 // field goes uninitialized. I don't know how to correctly calculate this | 396 // field goes uninitialized. I don't know how to correctly calculate this |
393 // field, but for now we will at least initialize it, even if it's wrong. | 397 // field, but for now we will at least initialize it, even if it's wrong. |
394 event_down.text = code; | 398 event_down.text[0] = code; |
395 #endif | 399 #endif |
396 | 400 |
397 if (args.size() >= 2 && (args[1].isObject() || args[1].isString())) | 401 if (args.size() >= 2 && (args[1].isObject() || args[1].isString())) |
398 ApplyKeyModifiers(&(args[1]), &event_down); | 402 ApplyKeyModifiers(&(args[1]), &event_down); |
399 | 403 |
400 if (needs_shift_key_modifier) | 404 if (needs_shift_key_modifier) |
401 event_down.modifiers |= WebInputEvent::SHIFT_KEY; | 405 event_down.modifiers |= WebInputEvent::SHIFT_KEY; |
402 | 406 |
403 event_up = event_down; | 407 event_up = event_down; |
404 event_up.type = WebInputEvent::KEY_UP; | 408 event_up.type = WebInputEvent::KEY_UP; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void EventSendingController::fireKeyboardEventsToElement( | 554 void EventSendingController::fireKeyboardEventsToElement( |
551 const CppArgumentList& args, CppVariant* result) { | 555 const CppArgumentList& args, CppVariant* result) { |
552 result->SetNull(); | 556 result->SetNull(); |
553 } | 557 } |
554 | 558 |
555 void EventSendingController::clearKillRing( | 559 void EventSendingController::clearKillRing( |
556 const CppArgumentList& args, CppVariant* result) { | 560 const CppArgumentList& args, CppVariant* result) { |
557 result->SetNull(); | 561 result->SetNull(); |
558 } | 562 } |
559 | 563 |
OLD | NEW |