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 <map> | 7 #include <map> |
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 case PP_INPUTEVENT_TYPE_TOUCHMOVE: | 299 case PP_INPUTEVENT_TYPE_TOUCHMOVE: |
300 web_event->type = WebInputEvent::TouchMove; | 300 web_event->type = WebInputEvent::TouchMove; |
301 state = WebTouchPoint::StateMoved; | 301 state = WebTouchPoint::StateMoved; |
302 break; | 302 break; |
303 case PP_INPUTEVENT_TYPE_TOUCHEND: | 303 case PP_INPUTEVENT_TYPE_TOUCHEND: |
304 web_event->type = WebInputEvent::TouchEnd; | 304 web_event->type = WebInputEvent::TouchEnd; |
305 state = WebTouchPoint::StateReleased; | 305 state = WebTouchPoint::StateReleased; |
306 break; | 306 break; |
307 case PP_INPUTEVENT_TYPE_TOUCHCANCEL: | 307 case PP_INPUTEVENT_TYPE_TOUCHCANCEL: |
308 web_event->type = WebInputEvent::TouchCancel; | 308 web_event->type = WebInputEvent::TouchCancel; |
| 309 web_event->cancelable = false; |
309 state = WebTouchPoint::StateCancelled; | 310 state = WebTouchPoint::StateCancelled; |
310 break; | 311 break; |
311 default: | 312 default: |
312 NOTREACHED(); | 313 NOTREACHED(); |
313 } | 314 } |
314 | 315 |
315 TouchStateMap states_map; | 316 TouchStateMap states_map; |
316 for (uint32_t i = 0; i < event.changed_touches.size(); i++) | 317 for (uint32_t i = 0; i < event.changed_touches.size(); i++) |
317 states_map[event.changed_touches[i].id] = state; | 318 states_map[event.changed_touches[i].id] = state; |
318 | 319 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 case WebInputEvent::TouchStart: | 730 case WebInputEvent::TouchStart: |
730 return PP_INPUTEVENT_CLASS_TOUCH; | 731 return PP_INPUTEVENT_CLASS_TOUCH; |
731 case WebInputEvent::Undefined: | 732 case WebInputEvent::Undefined: |
732 default: | 733 default: |
733 NOTREACHED(); | 734 NOTREACHED(); |
734 return PP_InputEvent_Class(0); | 735 return PP_InputEvent_Class(0); |
735 } | 736 } |
736 } | 737 } |
737 | 738 |
738 } // namespace content | 739 } // namespace content |
OLD | NEW |