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 "native_client/src/shared/ppapi_proxy/browser_ppp_input_event.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_ppp_input_event.h" |
6 | 6 |
7 #include "native_client/src/include/nacl_scoped_ptr.h" | 7 #include "native_client/src/include/nacl_scoped_ptr.h" |
8 #include "native_client/src/include/portability.h" | 8 #include "native_client/src/include/portability.h" |
9 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" | 9 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| 10 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" |
10 #include "native_client/src/shared/ppapi_proxy/input_event_data.h" | 11 #include "native_client/src/shared/ppapi_proxy/input_event_data.h" |
11 #include "native_client/src/shared/ppapi_proxy/object_serialize.h" | 12 #include "native_client/src/shared/ppapi_proxy/object_serialize.h" |
12 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" | |
13 #include "native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppp_rpc.h" | 13 #include "native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppp_rpc.h" |
14 #include "native_client/src/shared/ppapi_proxy/utility.h" | 14 #include "native_client/src/shared/ppapi_proxy/utility.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/ppp_input_event.h" | 16 #include "ppapi/c/ppp_input_event.h" |
17 | 17 |
18 namespace ppapi_proxy { | 18 namespace ppapi_proxy { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) { | 22 PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 case PP_INPUTEVENT_TYPE_UNDEFINED: | 69 case PP_INPUTEVENT_TYPE_UNDEFINED: |
70 return PP_FALSE; | 70 return PP_FALSE; |
71 // TODO(nfullagar): Implement support for event types below. | 71 // TODO(nfullagar): Implement support for event types below. |
72 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START: | 72 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START: |
73 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE: | 73 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE: |
74 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_END: | 74 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_END: |
75 case PP_INPUTEVENT_TYPE_IME_TEXT: | 75 case PP_INPUTEVENT_TYPE_IME_TEXT: |
76 DebugPrintf(" No implementation for event type %d\n", | 76 DebugPrintf(" No implementation for event type %d\n", |
77 data.event_type); | 77 data.event_type); |
78 return PP_FALSE; | 78 return PP_FALSE; |
| 79 case PP_INPUTEVENT_TYPE_TOUCHSTART: |
| 80 case PP_INPUTEVENT_TYPE_TOUCHMOVE: |
| 81 case PP_INPUTEVENT_TYPE_TOUCHEND: |
| 82 case PP_INPUTEVENT_TYPE_TOUCHCANCEL: |
| 83 DebugPrintf(" No implementation for event type %d\n", |
| 84 data.event_type); |
| 85 return PP_FALSE; |
79 // No default case; if any new types are added we should get a compile | 86 // No default case; if any new types are added we should get a compile |
80 // warning. | 87 // warning. |
81 } | 88 } |
82 // Now data and character_text have all the data we want to send to the | 89 // Now data and character_text have all the data we want to send to the |
83 // untrusted side. | 90 // untrusted side. |
84 | 91 |
85 // character_text should either be undefined or a string type. | 92 // character_text should either be undefined or a string type. |
86 DCHECK((character_text.type == PP_VARTYPE_UNDEFINED) || | 93 DCHECK((character_text.type == PP_VARTYPE_UNDEFINED) || |
87 (character_text.type == PP_VARTYPE_STRING)); | 94 (character_text.type == PP_VARTYPE_STRING)); |
88 // Serialize the character_text Var. | 95 // Serialize the character_text Var. |
(...skipping 27 matching lines...) Expand all Loading... |
116 } // namespace | 123 } // namespace |
117 | 124 |
118 const PPP_InputEvent* BrowserInputEvent::GetInterface() { | 125 const PPP_InputEvent* BrowserInputEvent::GetInterface() { |
119 static const PPP_InputEvent input_event_interface = { | 126 static const PPP_InputEvent input_event_interface = { |
120 HandleInputEvent | 127 HandleInputEvent |
121 }; | 128 }; |
122 return &input_event_interface; | 129 return &input_event_interface; |
123 } | 130 } |
124 | 131 |
125 } // namespace ppapi_proxy | 132 } // namespace ppapi_proxy |
OLD | NEW |