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

Side by Side Diff: content/renderer/pepper/event_conversion.cc

Issue 2707183003: Move //components/test_runner back into //content/shell (Closed)
Patch Set: Trim DEPS Created 3 years, 10 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
OLDNEW
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 #include "content/renderer/pepper/event_conversion.h" 5 #include "content/renderer/pepper/event_conversion.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 #define VK_SNAPSHOT 0x2C 499 #define VK_SNAPSHOT 0x2C
500 #define VK_INSERT 0x2D 500 #define VK_INSERT 0x2D
501 #define VK_DELETE 0x2E 501 #define VK_DELETE 0x2E
502 502
503 #define VK_APPS 0x5D 503 #define VK_APPS 0x5D
504 504
505 #define VK_F1 0x70 505 #define VK_F1 0x70
506 #endif 506 #endif
507 507
508 // Convert a character string to a Windows virtual key code. Adapted from 508 // Convert a character string to a Windows virtual key code. Adapted from
509 // src/components/test_runner/event_sender.cc. This 509 // src/content/shell/test_runner/event_sender.cc. This
510 // is used by CreateSimulatedWebInputEvents to convert keyboard events. 510 // is used by CreateSimulatedWebInputEvents to convert keyboard events.
511 void GetKeyCode(const std::string& char_text, 511 void GetKeyCode(const std::string& char_text,
512 WebUChar* code, 512 WebUChar* code,
513 WebUChar* text, 513 WebUChar* text,
514 bool* needs_shift_modifier, 514 bool* needs_shift_modifier,
515 bool* generate_char) { 515 bool* generate_char) {
516 WebUChar vk_code = 0; 516 WebUChar vk_code = 0;
517 WebUChar vk_text = 0; 517 WebUChar vk_text = 0;
518 *needs_shift_modifier = false; 518 *needs_shift_modifier = false;
519 *generate_char = false; 519 *generate_char = false;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 case PP_INPUTEVENT_TYPE_TOUCHEND: 644 case PP_INPUTEVENT_TYPE_TOUCHEND:
645 case PP_INPUTEVENT_TYPE_TOUCHCANCEL: 645 case PP_INPUTEVENT_TYPE_TOUCHCANCEL:
646 web_input_event.reset(BuildTouchEvent(event)); 646 web_input_event.reset(BuildTouchEvent(event));
647 break; 647 break;
648 } 648 }
649 649
650 return web_input_event.release(); 650 return web_input_event.release();
651 } 651 }
652 652
653 // Generate a coherent sequence of input events to simulate a user event. 653 // Generate a coherent sequence of input events to simulate a user event.
654 // From src/components/test_runner/event_sender.cc. 654 // From src/content/shell/test_runner/event_sender.cc.
655 std::vector<std::unique_ptr<WebInputEvent>> CreateSimulatedWebInputEvents( 655 std::vector<std::unique_ptr<WebInputEvent>> CreateSimulatedWebInputEvents(
656 const ppapi::InputEventData& event, 656 const ppapi::InputEventData& event,
657 int plugin_x, 657 int plugin_x,
658 int plugin_y) { 658 int plugin_y) {
659 std::vector<std::unique_ptr<WebInputEvent>> events; 659 std::vector<std::unique_ptr<WebInputEvent>> events;
660 std::unique_ptr<WebInputEvent> original_event(CreateWebInputEvent(event)); 660 std::unique_ptr<WebInputEvent> original_event(CreateWebInputEvent(event));
661 661
662 switch (event.event_type) { 662 switch (event.event_type) {
663 case PP_INPUTEVENT_TYPE_MOUSEDOWN: 663 case PP_INPUTEVENT_TYPE_MOUSEDOWN:
664 case PP_INPUTEVENT_TYPE_MOUSEUP: 664 case PP_INPUTEVENT_TYPE_MOUSEUP:
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 return PP_INPUTEVENT_CLASS_TOUCH; 767 return PP_INPUTEVENT_CLASS_TOUCH;
768 case WebInputEvent::TouchScrollStarted: 768 case WebInputEvent::TouchScrollStarted:
769 return PP_InputEvent_Class(0); 769 return PP_InputEvent_Class(0);
770 default: 770 default:
771 CHECK(WebInputEvent::isGestureEventType(event.type())); 771 CHECK(WebInputEvent::isGestureEventType(event.type()));
772 return PP_InputEvent_Class(0); 772 return PP_InputEvent_Class(0);
773 } 773 }
774 } 774 }
775 775
776 } // namespace content 776 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698