| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 static_cast<int>(WebInputEvent::NumLockOn), | 76 static_cast<int>(WebInputEvent::NumLockOn), |
| 77 "NumLock should match"); | 77 "NumLock should match"); |
| 78 static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISLEFT) == | 78 static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISLEFT) == |
| 79 static_cast<int>(WebInputEvent::IsLeft), | 79 static_cast<int>(WebInputEvent::IsLeft), |
| 80 "IsLeft should match"); | 80 "IsLeft should match"); |
| 81 static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISRIGHT) == | 81 static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISRIGHT) == |
| 82 static_cast<int>(WebInputEvent::IsRight), | 82 static_cast<int>(WebInputEvent::IsRight), |
| 83 "IsRight should match"); | 83 "IsRight should match"); |
| 84 | 84 |
| 85 PP_InputEvent_Type ConvertEventTypes(const WebInputEvent& event) { | 85 PP_InputEvent_Type ConvertEventTypes(const WebInputEvent& event) { |
| 86 switch (event.type) { | 86 switch (event.type()) { |
| 87 case WebInputEvent::MouseDown: | 87 case WebInputEvent::MouseDown: |
| 88 return PP_INPUTEVENT_TYPE_MOUSEDOWN; | 88 return PP_INPUTEVENT_TYPE_MOUSEDOWN; |
| 89 case WebInputEvent::MouseUp: | 89 case WebInputEvent::MouseUp: |
| 90 return PP_INPUTEVENT_TYPE_MOUSEUP; | 90 return PP_INPUTEVENT_TYPE_MOUSEUP; |
| 91 case WebInputEvent::MouseMove: | 91 case WebInputEvent::MouseMove: |
| 92 return PP_INPUTEVENT_TYPE_MOUSEMOVE; | 92 return PP_INPUTEVENT_TYPE_MOUSEMOVE; |
| 93 case WebInputEvent::MouseEnter: | 93 case WebInputEvent::MouseEnter: |
| 94 return PP_INPUTEVENT_TYPE_MOUSEENTER; | 94 return PP_INPUTEVENT_TYPE_MOUSEENTER; |
| 95 case WebInputEvent::MouseLeave: | 95 case WebInputEvent::MouseLeave: |
| 96 return PP_INPUTEVENT_TYPE_MOUSELEAVE; | 96 return PP_INPUTEVENT_TYPE_MOUSELEAVE; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 PP_INPUTEVENT_MODIFIER_ISLEFT | | 136 PP_INPUTEVENT_MODIFIER_ISLEFT | |
| 137 PP_INPUTEVENT_MODIFIER_ISRIGHT); | 137 PP_INPUTEVENT_MODIFIER_ISRIGHT); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Generates a PP_InputEvent with the fields common to all events, as well as | 140 // Generates a PP_InputEvent with the fields common to all events, as well as |
| 141 // the event type from the given web event. Event-specific fields will be zero | 141 // the event type from the given web event. Event-specific fields will be zero |
| 142 // initialized. | 142 // initialized. |
| 143 InputEventData GetEventWithCommonFieldsAndType(const WebInputEvent& web_event) { | 143 InputEventData GetEventWithCommonFieldsAndType(const WebInputEvent& web_event) { |
| 144 InputEventData result; | 144 InputEventData result; |
| 145 result.event_type = ConvertEventTypes(web_event); | 145 result.event_type = ConvertEventTypes(web_event); |
| 146 result.event_time_stamp = web_event.timeStampSeconds; | 146 result.event_time_stamp = web_event.timeStampSeconds(); |
| 147 return result; | 147 return result; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void AppendKeyEvent(const WebInputEvent& event, | 150 void AppendKeyEvent(const WebInputEvent& event, |
| 151 std::vector<InputEventData>* result_events) { | 151 std::vector<InputEventData>* result_events) { |
| 152 const WebKeyboardEvent& key_event = | 152 const WebKeyboardEvent& key_event = |
| 153 static_cast<const WebKeyboardEvent&>(event); | 153 static_cast<const WebKeyboardEvent&>(event); |
| 154 InputEventData result = GetEventWithCommonFieldsAndType(event); | 154 InputEventData result = GetEventWithCommonFieldsAndType(event); |
| 155 result.event_modifiers = ConvertEventModifiers(key_event.modifiers); | 155 result.event_modifiers = ConvertEventModifiers(key_event.modifiers()); |
| 156 result.key_code = key_event.windowsKeyCode; | 156 result.key_code = key_event.windowsKeyCode; |
| 157 result.code = ui::KeycodeConverter::DomCodeToCodeString( | 157 result.code = ui::KeycodeConverter::DomCodeToCodeString( |
| 158 static_cast<ui::DomCode>(key_event.domCode)); | 158 static_cast<ui::DomCode>(key_event.domCode)); |
| 159 result_events->push_back(result); | 159 result_events->push_back(result); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void AppendCharEvent(const WebInputEvent& event, | 162 void AppendCharEvent(const WebInputEvent& event, |
| 163 std::vector<InputEventData>* result_events) { | 163 std::vector<InputEventData>* result_events) { |
| 164 const WebKeyboardEvent& key_event = | 164 const WebKeyboardEvent& key_event = |
| 165 static_cast<const WebKeyboardEvent&>(event); | 165 static_cast<const WebKeyboardEvent&>(event); |
| 166 | 166 |
| 167 // This is a bit complex, the input event will normally just have one 16-bit | 167 // This is a bit complex, the input event will normally just have one 16-bit |
| 168 // character in it, but may be zero or more than one. The text array is | 168 // character in it, but may be zero or more than one. The text array is |
| 169 // just padded with 0 values for the unused ones, but is not necessarily | 169 // just padded with 0 values for the unused ones, but is not necessarily |
| 170 // null-terminated. | 170 // null-terminated. |
| 171 // | 171 // |
| 172 // Here we see how many UTF-16 characters we have. | 172 // Here we see how many UTF-16 characters we have. |
| 173 size_t utf16_char_count = 0; | 173 size_t utf16_char_count = 0; |
| 174 while (utf16_char_count < WebKeyboardEvent::textLengthCap && | 174 while (utf16_char_count < WebKeyboardEvent::textLengthCap && |
| 175 key_event.text[utf16_char_count]) | 175 key_event.text[utf16_char_count]) |
| 176 utf16_char_count++; | 176 utf16_char_count++; |
| 177 | 177 |
| 178 // Make a separate InputEventData for each Unicode character in the input. | 178 // Make a separate InputEventData for each Unicode character in the input. |
| 179 base::i18n::UTF16CharIterator iter(key_event.text, utf16_char_count); | 179 base::i18n::UTF16CharIterator iter(key_event.text, utf16_char_count); |
| 180 while (!iter.end()) { | 180 while (!iter.end()) { |
| 181 InputEventData result = GetEventWithCommonFieldsAndType(event); | 181 InputEventData result = GetEventWithCommonFieldsAndType(event); |
| 182 result.event_modifiers = ConvertEventModifiers(key_event.modifiers); | 182 result.event_modifiers = ConvertEventModifiers(key_event.modifiers()); |
| 183 base::WriteUnicodeCharacter(iter.get(), &result.character_text); | 183 base::WriteUnicodeCharacter(iter.get(), &result.character_text); |
| 184 | 184 |
| 185 result_events->push_back(result); | 185 result_events->push_back(result); |
| 186 iter.Advance(); | 186 iter.Advance(); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void AppendMouseEvent(const WebInputEvent& event, | 190 void AppendMouseEvent(const WebInputEvent& event, |
| 191 std::vector<InputEventData>* result_events) { | 191 std::vector<InputEventData>* result_events) { |
| 192 static_assert(static_cast<int>(WebMouseEvent::Button::NoButton) == | 192 static_assert(static_cast<int>(WebMouseEvent::Button::NoButton) == |
| 193 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_NONE), | 193 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_NONE), |
| 194 "MouseNone should match"); | 194 "MouseNone should match"); |
| 195 static_assert(static_cast<int>(WebMouseEvent::Button::Left) == | 195 static_assert(static_cast<int>(WebMouseEvent::Button::Left) == |
| 196 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_LEFT), | 196 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_LEFT), |
| 197 "MouseLeft should match"); | 197 "MouseLeft should match"); |
| 198 static_assert(static_cast<int>(WebMouseEvent::Button::Right) == | 198 static_assert(static_cast<int>(WebMouseEvent::Button::Right) == |
| 199 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_RIGHT), | 199 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_RIGHT), |
| 200 "MouseRight should match"); | 200 "MouseRight should match"); |
| 201 static_assert(static_cast<int>(WebMouseEvent::Button::Middle) == | 201 static_assert(static_cast<int>(WebMouseEvent::Button::Middle) == |
| 202 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_MIDDLE), | 202 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_MIDDLE), |
| 203 "MouseMiddle should match"); | 203 "MouseMiddle should match"); |
| 204 | 204 |
| 205 const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event); | 205 const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event); |
| 206 InputEventData result = GetEventWithCommonFieldsAndType(event); | 206 InputEventData result = GetEventWithCommonFieldsAndType(event); |
| 207 result.event_modifiers = ConvertEventModifiers(mouse_event.modifiers); | 207 result.event_modifiers = ConvertEventModifiers(mouse_event.modifiers()); |
| 208 if (mouse_event.type == WebInputEvent::MouseDown || | 208 if (mouse_event.type() == WebInputEvent::MouseDown || |
| 209 mouse_event.type == WebInputEvent::MouseMove || | 209 mouse_event.type() == WebInputEvent::MouseMove || |
| 210 mouse_event.type == WebInputEvent::MouseUp) { | 210 mouse_event.type() == WebInputEvent::MouseUp) { |
| 211 result.mouse_button = | 211 result.mouse_button = |
| 212 static_cast<PP_InputEvent_MouseButton>(mouse_event.button); | 212 static_cast<PP_InputEvent_MouseButton>(mouse_event.button); |
| 213 } | 213 } |
| 214 result.mouse_position.x = mouse_event.x; | 214 result.mouse_position.x = mouse_event.x; |
| 215 result.mouse_position.y = mouse_event.y; | 215 result.mouse_position.y = mouse_event.y; |
| 216 result.mouse_click_count = mouse_event.clickCount; | 216 result.mouse_click_count = mouse_event.clickCount; |
| 217 result.mouse_movement.x = mouse_event.movementX; | 217 result.mouse_movement.x = mouse_event.movementX; |
| 218 result.mouse_movement.y = mouse_event.movementY; | 218 result.mouse_movement.y = mouse_event.movementY; |
| 219 result_events->push_back(result); | 219 result_events->push_back(result); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void AppendMouseWheelEvent(const WebInputEvent& event, | 222 void AppendMouseWheelEvent(const WebInputEvent& event, |
| 223 std::vector<InputEventData>* result_events) { | 223 std::vector<InputEventData>* result_events) { |
| 224 const WebMouseWheelEvent& mouse_wheel_event = | 224 const WebMouseWheelEvent& mouse_wheel_event = |
| 225 static_cast<const WebMouseWheelEvent&>(event); | 225 static_cast<const WebMouseWheelEvent&>(event); |
| 226 InputEventData result = GetEventWithCommonFieldsAndType(event); | 226 InputEventData result = GetEventWithCommonFieldsAndType(event); |
| 227 result.event_modifiers = ConvertEventModifiers(mouse_wheel_event.modifiers); | 227 result.event_modifiers = ConvertEventModifiers(mouse_wheel_event.modifiers()); |
| 228 result.wheel_delta.x = mouse_wheel_event.deltaX; | 228 result.wheel_delta.x = mouse_wheel_event.deltaX; |
| 229 result.wheel_delta.y = mouse_wheel_event.deltaY; | 229 result.wheel_delta.y = mouse_wheel_event.deltaY; |
| 230 result.wheel_ticks.x = mouse_wheel_event.wheelTicksX; | 230 result.wheel_ticks.x = mouse_wheel_event.wheelTicksX; |
| 231 result.wheel_ticks.y = mouse_wheel_event.wheelTicksY; | 231 result.wheel_ticks.y = mouse_wheel_event.wheelTicksY; |
| 232 result.wheel_scroll_by_page = !!mouse_wheel_event.scrollByPage; | 232 result.wheel_scroll_by_page = !!mouse_wheel_event.scrollByPage; |
| 233 result_events->push_back(result); | 233 result_events->push_back(result); |
| 234 } | 234 } |
| 235 | 235 |
| 236 enum IncludedTouchPointTypes { | 236 enum IncludedTouchPointTypes { |
| 237 ALL, // All pointers targetting the plugin. | 237 ALL, // All pointers targetting the plugin. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 case PP_INPUTEVENT_TYPE_CONTEXTMENU: | 449 case PP_INPUTEVENT_TYPE_CONTEXTMENU: |
| 450 type = WebInputEvent::ContextMenu; | 450 type = WebInputEvent::ContextMenu; |
| 451 break; | 451 break; |
| 452 default: | 452 default: |
| 453 NOTREACHED(); | 453 NOTREACHED(); |
| 454 } | 454 } |
| 455 WebMouseEvent* mouse_event = | 455 WebMouseEvent* mouse_event = |
| 456 new WebMouseEvent(type, event.event_modifiers, event.event_time_stamp); | 456 new WebMouseEvent(type, event.event_modifiers, event.event_time_stamp); |
| 457 mouse_event->pointerType = blink::WebPointerProperties::PointerType::Mouse; | 457 mouse_event->pointerType = blink::WebPointerProperties::PointerType::Mouse; |
| 458 mouse_event->button = static_cast<WebMouseEvent::Button>(event.mouse_button); | 458 mouse_event->button = static_cast<WebMouseEvent::Button>(event.mouse_button); |
| 459 if (mouse_event->type == WebInputEvent::MouseMove) { | 459 if (mouse_event->type() == WebInputEvent::MouseMove) { |
| 460 if (mouse_event->modifiers & WebInputEvent::LeftButtonDown) | 460 if (mouse_event->modifiers() & WebInputEvent::LeftButtonDown) |
| 461 mouse_event->button = WebMouseEvent::Button::Left; | 461 mouse_event->button = WebMouseEvent::Button::Left; |
| 462 else if (mouse_event->modifiers & WebInputEvent::MiddleButtonDown) | 462 else if (mouse_event->modifiers() & WebInputEvent::MiddleButtonDown) |
| 463 mouse_event->button = WebMouseEvent::Button::Middle; | 463 mouse_event->button = WebMouseEvent::Button::Middle; |
| 464 else if (mouse_event->modifiers & WebInputEvent::RightButtonDown) | 464 else if (mouse_event->modifiers() & WebInputEvent::RightButtonDown) |
| 465 mouse_event->button = WebMouseEvent::Button::Right; | 465 mouse_event->button = WebMouseEvent::Button::Right; |
| 466 } | 466 } |
| 467 mouse_event->x = event.mouse_position.x; | 467 mouse_event->x = event.mouse_position.x; |
| 468 mouse_event->y = event.mouse_position.y; | 468 mouse_event->y = event.mouse_position.y; |
| 469 mouse_event->clickCount = event.mouse_click_count; | 469 mouse_event->clickCount = event.mouse_click_count; |
| 470 mouse_event->movementX = event.mouse_movement.x; | 470 mouse_event->movementX = event.mouse_movement.x; |
| 471 mouse_event->movementY = event.mouse_movement.y; | 471 mouse_event->movementY = event.mouse_movement.y; |
| 472 return mouse_event; | 472 return mouse_event; |
| 473 } | 473 } |
| 474 | 474 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 *code = vk_code; | 566 *code = vk_code; |
| 567 *text = vk_text; | 567 *text = vk_text; |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace | 570 } // namespace |
| 571 | 571 |
| 572 void CreateInputEventData(const WebInputEvent& event, | 572 void CreateInputEventData(const WebInputEvent& event, |
| 573 std::vector<InputEventData>* result) { | 573 std::vector<InputEventData>* result) { |
| 574 result->clear(); | 574 result->clear(); |
| 575 | 575 |
| 576 switch (event.type) { | 576 switch (event.type()) { |
| 577 case WebInputEvent::MouseDown: | 577 case WebInputEvent::MouseDown: |
| 578 case WebInputEvent::MouseUp: | 578 case WebInputEvent::MouseUp: |
| 579 case WebInputEvent::MouseMove: | 579 case WebInputEvent::MouseMove: |
| 580 case WebInputEvent::MouseEnter: | 580 case WebInputEvent::MouseEnter: |
| 581 case WebInputEvent::MouseLeave: | 581 case WebInputEvent::MouseLeave: |
| 582 case WebInputEvent::ContextMenu: | 582 case WebInputEvent::ContextMenu: |
| 583 AppendMouseEvent(event, result); | 583 AppendMouseEvent(event, result); |
| 584 break; | 584 break; |
| 585 case WebInputEvent::MouseWheel: | 585 case WebInputEvent::MouseWheel: |
| 586 AppendMouseWheelEvent(event, result); | 586 AppendMouseWheelEvent(event, result); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 break; | 679 break; |
| 680 } | 680 } |
| 681 | 681 |
| 682 case PP_INPUTEVENT_TYPE_RAWKEYDOWN: | 682 case PP_INPUTEVENT_TYPE_RAWKEYDOWN: |
| 683 case PP_INPUTEVENT_TYPE_KEYDOWN: | 683 case PP_INPUTEVENT_TYPE_KEYDOWN: |
| 684 case PP_INPUTEVENT_TYPE_KEYUP: { | 684 case PP_INPUTEVENT_TYPE_KEYUP: { |
| 685 // Windows key down events should always be "raw" to avoid an ASSERT. | 685 // Windows key down events should always be "raw" to avoid an ASSERT. |
| 686 #if defined(OS_WIN) | 686 #if defined(OS_WIN) |
| 687 WebKeyboardEvent* web_keyboard_event = | 687 WebKeyboardEvent* web_keyboard_event = |
| 688 static_cast<WebKeyboardEvent*>(original_event.get()); | 688 static_cast<WebKeyboardEvent*>(original_event.get()); |
| 689 if (web_keyboard_event->type == WebInputEvent::KeyDown) | 689 if (web_keyboard_event->type() == WebInputEvent::KeyDown) |
| 690 web_keyboard_event->type = WebInputEvent::RawKeyDown; | 690 web_keyboard_event->setType(WebInputEvent::RawKeyDown); |
| 691 #endif | 691 #endif |
| 692 events.push_back(std::move(original_event)); | 692 events.push_back(std::move(original_event)); |
| 693 break; | 693 break; |
| 694 } | 694 } |
| 695 | 695 |
| 696 case PP_INPUTEVENT_TYPE_CHAR: { | 696 case PP_INPUTEVENT_TYPE_CHAR: { |
| 697 WebKeyboardEvent* web_char_event = | 697 WebKeyboardEvent* web_char_event = |
| 698 static_cast<WebKeyboardEvent*>(original_event.get()); | 698 static_cast<WebKeyboardEvent*>(original_event.get()); |
| 699 | 699 |
| 700 WebUChar code = 0, text = 0; | 700 WebUChar code = 0, text = 0; |
| 701 bool needs_shift_modifier = false, generate_char = false; | 701 bool needs_shift_modifier = false, generate_char = false; |
| 702 GetKeyCode(event.character_text, | 702 GetKeyCode(event.character_text, |
| 703 &code, | 703 &code, |
| 704 &text, | 704 &text, |
| 705 &needs_shift_modifier, | 705 &needs_shift_modifier, |
| 706 &generate_char); | 706 &generate_char); |
| 707 | 707 |
| 708 // Synthesize key down and key up events in all cases. | 708 // Synthesize key down and key up events in all cases. |
| 709 std::unique_ptr<WebKeyboardEvent> key_down_event(new WebKeyboardEvent( | 709 std::unique_ptr<WebKeyboardEvent> key_down_event(new WebKeyboardEvent( |
| 710 WebInputEvent::RawKeyDown, | 710 WebInputEvent::RawKeyDown, |
| 711 needs_shift_modifier ? WebInputEvent::ShiftKey | 711 needs_shift_modifier ? WebInputEvent::ShiftKey |
| 712 : WebInputEvent::NoModifiers, | 712 : WebInputEvent::NoModifiers, |
| 713 web_char_event->timeStampSeconds)); | 713 web_char_event->timeStampSeconds())); |
| 714 std::unique_ptr<WebKeyboardEvent> key_up_event(new WebKeyboardEvent()); | 714 std::unique_ptr<WebKeyboardEvent> key_up_event(new WebKeyboardEvent()); |
| 715 | 715 |
| 716 key_down_event->windowsKeyCode = code; | 716 key_down_event->windowsKeyCode = code; |
| 717 key_down_event->nativeKeyCode = code; | 717 key_down_event->nativeKeyCode = code; |
| 718 | 718 |
| 719 // If a char event is needed, set the text fields. | 719 // If a char event is needed, set the text fields. |
| 720 if (generate_char) { | 720 if (generate_char) { |
| 721 key_down_event->text[0] = text; | 721 key_down_event->text[0] = text; |
| 722 key_down_event->unmodifiedText[0] = text; | 722 key_down_event->unmodifiedText[0] = text; |
| 723 } | 723 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 736 break; | 736 break; |
| 737 } | 737 } |
| 738 | 738 |
| 739 default: | 739 default: |
| 740 break; | 740 break; |
| 741 } | 741 } |
| 742 return events; | 742 return events; |
| 743 } | 743 } |
| 744 | 744 |
| 745 PP_InputEvent_Class ClassifyInputEvent(const WebInputEvent& event) { | 745 PP_InputEvent_Class ClassifyInputEvent(const WebInputEvent& event) { |
| 746 switch (event.type) { | 746 switch (event.type()) { |
| 747 case WebInputEvent::MouseDown: | 747 case WebInputEvent::MouseDown: |
| 748 case WebInputEvent::MouseUp: | 748 case WebInputEvent::MouseUp: |
| 749 case WebInputEvent::MouseMove: | 749 case WebInputEvent::MouseMove: |
| 750 case WebInputEvent::MouseEnter: | 750 case WebInputEvent::MouseEnter: |
| 751 case WebInputEvent::MouseLeave: | 751 case WebInputEvent::MouseLeave: |
| 752 case WebInputEvent::ContextMenu: | 752 case WebInputEvent::ContextMenu: |
| 753 return PP_INPUTEVENT_CLASS_MOUSE; | 753 return PP_INPUTEVENT_CLASS_MOUSE; |
| 754 case WebInputEvent::MouseWheel: | 754 case WebInputEvent::MouseWheel: |
| 755 return PP_INPUTEVENT_CLASS_WHEEL; | 755 return PP_INPUTEVENT_CLASS_WHEEL; |
| 756 case WebInputEvent::RawKeyDown: | 756 case WebInputEvent::RawKeyDown: |
| 757 case WebInputEvent::KeyDown: | 757 case WebInputEvent::KeyDown: |
| 758 case WebInputEvent::KeyUp: | 758 case WebInputEvent::KeyUp: |
| 759 case WebInputEvent::Char: | 759 case WebInputEvent::Char: |
| 760 return PP_INPUTEVENT_CLASS_KEYBOARD; | 760 return PP_INPUTEVENT_CLASS_KEYBOARD; |
| 761 case WebInputEvent::TouchCancel: | 761 case WebInputEvent::TouchCancel: |
| 762 case WebInputEvent::TouchEnd: | 762 case WebInputEvent::TouchEnd: |
| 763 case WebInputEvent::TouchMove: | 763 case WebInputEvent::TouchMove: |
| 764 case WebInputEvent::TouchStart: | 764 case WebInputEvent::TouchStart: |
| 765 return PP_INPUTEVENT_CLASS_TOUCH; | 765 return PP_INPUTEVENT_CLASS_TOUCH; |
| 766 case WebInputEvent::TouchScrollStarted: | 766 case WebInputEvent::TouchScrollStarted: |
| 767 return PP_InputEvent_Class(0); | 767 return PP_InputEvent_Class(0); |
| 768 default: | 768 default: |
| 769 CHECK(WebInputEvent::isGestureEventType(event.type)); | 769 CHECK(WebInputEvent::isGestureEventType(event.type())); |
| 770 return PP_InputEvent_Class(0); | 770 return PP_InputEvent_Class(0); |
| 771 } | 771 } |
| 772 } | 772 } |
| 773 | 773 |
| 774 } // namespace content | 774 } // namespace content |
| OLD | NEW |