Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: webkit/tools/test_shell/event_sending_controller.cc

Issue 8026: Remove WebKeyboardEvent::key_data because we don't actually use it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webview_impl.cc ('k') | webkit/tools/test_shell/keyboard_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 399
400 // NOTE(jnd):For one keydown event, we need to generate 400 // NOTE(jnd):For one keydown event, we need to generate
401 // keyDown/keyUp pair, refer EventSender.cpp in 401 // keyDown/keyUp pair, refer EventSender.cpp in
402 // WebKit/WebKitTools/DumpRenderTree/win. We may also need 402 // WebKit/WebKitTools/DumpRenderTree/win. We may also need
403 // to generate a keyChar event in certain cases. 403 // to generate a keyChar event in certain cases.
404 WebKeyboardEvent event_down, event_up; 404 WebKeyboardEvent event_down, event_up;
405 event_down.type = WebInputEvent::KEY_DOWN; 405 event_down.type = WebInputEvent::KEY_DOWN;
406 event_down.modifiers = 0; 406 event_down.modifiers = 0;
407 event_down.key_code = code; 407 event_down.key_code = code;
408 event_down.key_data = code;
409 408
410 if (args.size() >= 2 && args[1].isObject()) 409 if (args.size() >= 2 && args[1].isObject())
411 ApplyKeyModifiers(&(args[1]), &event_down); 410 ApplyKeyModifiers(&(args[1]), &event_down);
412 411
413 if (needs_shift_key_modifier) 412 if (needs_shift_key_modifier)
414 event_down.modifiers |= WebInputEvent::SHIFT_KEY; 413 event_down.modifiers |= WebInputEvent::SHIFT_KEY;
415 414
416 event_up = event_down; 415 event_up = event_down;
417 event_up.type = WebInputEvent::KEY_UP; 416 event_up.type = WebInputEvent::KEY_UP;
418 // EventSendingController.m forces a layout here, with at least one 417 // EventSendingController.m forces a layout here, with at least one
419 // test (fast\forms\focus-control-to-page.html) relying on this. 418 // test (fast\forms\focus-control-to-page.html) relying on this.
420 webview()->Layout(); 419 webview()->Layout();
421 420
422 webview()->HandleInputEvent(&event_down); 421 webview()->HandleInputEvent(&event_down);
423 422
424 if (generate_char) { 423 if (generate_char) {
425 WebKeyboardEvent event_char = event_down; 424 WebKeyboardEvent event_char = event_down;
426 if (event_down.modifiers & WebInputEvent::SHIFT_KEY) { 425 if (event_down.modifiers & WebInputEvent::SHIFT_KEY) {
427 // Special case for the following characters when the shift key is 426 // Special case for the following characters when the shift key is
428 // pressed in conjunction with these characters. 427 // pressed in conjunction with these characters.
429 // Windows generates a WM_KEYDOWN message with the ASCII code of 428 // Windows generates a WM_KEYDOWN message with the ASCII code of
430 // the character followed by a WM_CHAR for the corresponding 429 // the character followed by a WM_CHAR for the corresponding
431 // virtual key code. 430 // virtual key code.
432 // We check for these keys to catch regressions in keyEvent handling 431 // We check for these keys to catch regressions in keyEvent handling
433 // in webkit. 432 // in webkit.
434 switch(code) { 433 switch(code) {
435 case '5': 434 case '5':
436 event_char.key_code = kPercentVirtualKeyCode; 435 event_char.key_code = kPercentVirtualKeyCode;
437 event_char.key_data = kPercentVirtualKeyCode;
438 break; 436 break;
439 case '7': 437 case '7':
440 event_char.key_code = kAmpersandVirtualKeyCode; 438 event_char.key_code = kAmpersandVirtualKeyCode;
441 event_char.key_data = kAmpersandVirtualKeyCode;
442 break; 439 break;
443 case '9': 440 case '9':
444 event_char.key_code = kLeftParenthesesVirtualKeyCode; 441 event_char.key_code = kLeftParenthesesVirtualKeyCode;
445 event_char.key_data = kLeftParenthesesVirtualKeyCode;
446 break; 442 break;
447 case '0': 443 case '0':
448 event_char.key_code = kRightParenthesesVirtualKeyCode; 444 event_char.key_code = kRightParenthesesVirtualKeyCode;
449 event_char.key_data = kRightParenthesesVirtualKeyCode;
450 break; 445 break;
451 #if defined(OS_WIN) 446 #if defined(OS_WIN)
452 // '[{' for US 447 // '[{' for US
453 case VK_OEM_4: 448 case VK_OEM_4:
454 event_char.key_code = kLeftCurlyBracketVirtualKeyCode; 449 event_char.key_code = kLeftCurlyBracketVirtualKeyCode;
455 event_char.key_data = kLeftCurlyBracketVirtualKeyCode;
456 break; 450 break;
457 // ']}' for US 451 // ']}' for US
458 case VK_OEM_6: 452 case VK_OEM_6:
459 event_char.key_code = kRightCurlyBracketVirtualKeyCode; 453 event_char.key_code = kRightCurlyBracketVirtualKeyCode;
460 event_char.key_data = kRightCurlyBracketVirtualKeyCode;
461 break; 454 break;
462 #endif 455 #endif
463 default: 456 default:
464 break; 457 break;
465 } 458 }
466 } 459 }
467 event_char.type = WebInputEvent::CHAR; 460 event_char.type = WebInputEvent::CHAR;
468 webview()->HandleInputEvent(&event_char); 461 webview()->HandleInputEvent(&event_char);
469 } 462 }
470 463
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 void EventSendingController::fireKeyboardEventsToElement( 559 void EventSendingController::fireKeyboardEventsToElement(
567 const CppArgumentList& args, CppVariant* result) { 560 const CppArgumentList& args, CppVariant* result) {
568 result->SetNull(); 561 result->SetNull();
569 } 562 }
570 563
571 void EventSendingController::clearKillRing( 564 void EventSendingController::clearKillRing(
572 const CppArgumentList& args, CppVariant* result) { 565 const CppArgumentList& args, CppVariant* result) {
573 result->SetNull(); 566 result->SetNull();
574 } 567 }
575 568
OLDNEW
« no previous file with comments | « webkit/glue/webview_impl.cc ('k') | webkit/tools/test_shell/keyboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698