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 <map> | 5 #include <map> |
6 | 6 |
7 #include "webkit/plugins/ppapi/event_conversion.h" | 7 #include "webkit/plugins/ppapi/event_conversion.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/i18n/char_iterator.h" | 10 #include "base/i18n/char_iterator.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 MouseRight); | 184 MouseRight); |
185 COMPILE_ASSERT(static_cast<int>(WebMouseEvent::ButtonMiddle) == | 185 COMPILE_ASSERT(static_cast<int>(WebMouseEvent::ButtonMiddle) == |
186 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_MIDDLE), | 186 static_cast<int>(PP_INPUTEVENT_MOUSEBUTTON_MIDDLE), |
187 MouseMiddle); | 187 MouseMiddle); |
188 | 188 |
189 const WebMouseEvent& mouse_event = | 189 const WebMouseEvent& mouse_event = |
190 static_cast<const WebMouseEvent&>(event); | 190 static_cast<const WebMouseEvent&>(event); |
191 InputEventData result = GetEventWithCommonFieldsAndType(event); | 191 InputEventData result = GetEventWithCommonFieldsAndType(event); |
192 result.event_modifiers = mouse_event.modifiers; | 192 result.event_modifiers = mouse_event.modifiers; |
193 if (mouse_event.type == WebInputEvent::MouseDown || | 193 if (mouse_event.type == WebInputEvent::MouseDown || |
| 194 mouse_event.type == WebInputEvent::MouseMove || |
194 mouse_event.type == WebInputEvent::MouseUp) { | 195 mouse_event.type == WebInputEvent::MouseUp) { |
195 result.mouse_button = | 196 result.mouse_button = |
196 static_cast<PP_InputEvent_MouseButton>(mouse_event.button); | 197 static_cast<PP_InputEvent_MouseButton>(mouse_event.button); |
197 } | 198 } |
198 result.mouse_position.x = mouse_event.x; | 199 result.mouse_position.x = mouse_event.x; |
199 result.mouse_position.y = mouse_event.y; | 200 result.mouse_position.y = mouse_event.y; |
200 result.mouse_click_count = mouse_event.clickCount; | 201 result.mouse_click_count = mouse_event.clickCount; |
201 result.mouse_movement.x = mouse_event.movementX; | 202 result.mouse_movement.x = mouse_event.movementX; |
202 result.mouse_movement.y = mouse_event.movementY; | 203 result.mouse_movement.y = mouse_event.movementY; |
203 result_events->push_back(result); | 204 result_events->push_back(result); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 return PP_INPUTEVENT_CLASS_TOUCH; | 726 return PP_INPUTEVENT_CLASS_TOUCH; |
726 case WebInputEvent::Undefined: | 727 case WebInputEvent::Undefined: |
727 default: | 728 default: |
728 NOTREACHED(); | 729 NOTREACHED(); |
729 return PP_InputEvent_Class(0); | 730 return PP_InputEvent_Class(0); |
730 } | 731 } |
731 } | 732 } |
732 | 733 |
733 } // namespace ppapi | 734 } // namespace ppapi |
734 } // namespace webkit | 735 } // namespace webkit |
OLD | NEW |