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 | |
388 event_down.type = WebInputEvent::KEY_DOWN; | 385 event_down.type = WebInputEvent::KEY_DOWN; |
389 #endif | |
390 event_down.modifiers = 0; | 386 event_down.modifiers = 0; |
391 event_down.windows_key_code = code; | 387 event_down.key_code = code; |
392 #if defined(OS_MAC) || defined(OS_LINUX) | 388 #if defined(OS_LINUX) |
393 // TODO(deanm): This code is a confusing mix of different platform key | 389 // TODO(deanm): This code is a confusing mix of different platform key |
394 // codes. Since we're not working with a GDK event, we can't use our | 390 // codes. Since we're not working with a GDK event, we can't use our |
395 // GDK -> WebKit converter, which means the Linux specific extra |text| | 391 // GDK -> WebKit converter, which means the Linux specific extra |text| |
396 // field goes uninitialized. I don't know how to correctly calculate this | 392 // field goes uninitialized. I don't know how to correctly calculate this |
397 // field, but for now we will at least initialize it, even if it's wrong. | 393 // field, but for now we will at least initialize it, even if it's wrong. |
398 event_down.text[0] = code; | 394 event_down.text = code; |
399 #endif | 395 #endif |
400 | 396 |
401 if (args.size() >= 2 && (args[1].isObject() || args[1].isString())) | 397 if (args.size() >= 2 && (args[1].isObject() || args[1].isString())) |
402 ApplyKeyModifiers(&(args[1]), &event_down); | 398 ApplyKeyModifiers(&(args[1]), &event_down); |
403 | 399 |
404 if (needs_shift_key_modifier) | 400 if (needs_shift_key_modifier) |
405 event_down.modifiers |= WebInputEvent::SHIFT_KEY; | 401 event_down.modifiers |= WebInputEvent::SHIFT_KEY; |
406 | 402 |
407 event_up = event_down; | 403 event_up = event_down; |
408 event_up.type = WebInputEvent::KEY_UP; | 404 event_up.type = WebInputEvent::KEY_UP; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 void EventSendingController::fireKeyboardEventsToElement( | 550 void EventSendingController::fireKeyboardEventsToElement( |
555 const CppArgumentList& args, CppVariant* result) { | 551 const CppArgumentList& args, CppVariant* result) { |
556 result->SetNull(); | 552 result->SetNull(); |
557 } | 553 } |
558 | 554 |
559 void EventSendingController::clearKillRing( | 555 void EventSendingController::clearKillRing( |
560 const CppArgumentList& args, CppVariant* result) { | 556 const CppArgumentList& args, CppVariant* result) { |
561 result->SetNull(); | 557 result->SetNull(); |
562 } | 558 } |
563 | 559 |
OLD | NEW |