| 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 "ppapi/proxy/resource_creation_proxy.h" | 5 #include "ppapi/proxy/resource_creation_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/pp_size.h" | 8 #include "ppapi/c/pp_size.h" |
| 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return PPB_ImageData_Proxy::CreateProxyResource(instance, format, size, | 180 return PPB_ImageData_Proxy::CreateProxyResource(instance, format, size, |
| 181 init_to_zero); | 181 init_to_zero); |
| 182 } | 182 } |
| 183 | 183 |
| 184 PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( | 184 PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( |
| 185 PP_Instance instance, | 185 PP_Instance instance, |
| 186 PP_InputEvent_Type type, | 186 PP_InputEvent_Type type, |
| 187 PP_TimeTicks time_stamp, | 187 PP_TimeTicks time_stamp, |
| 188 uint32_t modifiers, | 188 uint32_t modifiers, |
| 189 uint32_t key_code, | 189 uint32_t key_code, |
| 190 uint32_t usb_scan_code, |
| 190 struct PP_Var character_text) { | 191 struct PP_Var character_text) { |
| 191 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && | 192 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && |
| 192 type != PP_INPUTEVENT_TYPE_KEYDOWN && | 193 type != PP_INPUTEVENT_TYPE_KEYDOWN && |
| 193 type != PP_INPUTEVENT_TYPE_KEYUP && | 194 type != PP_INPUTEVENT_TYPE_KEYUP && |
| 194 type != PP_INPUTEVENT_TYPE_CHAR) | 195 type != PP_INPUTEVENT_TYPE_CHAR) |
| 195 return 0; | 196 return 0; |
| 196 InputEventData data; | 197 InputEventData data; |
| 197 data.event_type = type; | 198 data.event_type = type; |
| 198 data.event_time_stamp = time_stamp; | 199 data.event_time_stamp = time_stamp; |
| 199 data.event_modifiers = modifiers; | 200 data.event_modifiers = modifiers; |
| 200 data.key_code = key_code; | 201 data.key_code = key_code; |
| 202 data.usb_scan_code = usb_scan_code; |
| 201 if (character_text.type == PP_VARTYPE_STRING) { | 203 if (character_text.type == PP_VARTYPE_STRING) { |
| 202 StringVar* text_str = StringVar::FromPPVar(character_text); | 204 StringVar* text_str = StringVar::FromPPVar(character_text); |
| 203 if (!text_str) | 205 if (!text_str) |
| 204 return 0; | 206 return 0; |
| 205 data.character_text = text_str->value(); | 207 data.character_text = text_str->value(); |
| 206 } | 208 } |
| 207 | 209 |
| 208 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsProxy(), | 210 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsProxy(), |
| 209 instance, data))->GetReference(); | 211 instance, data))->GetReference(); |
| 210 } | 212 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 bool ResourceCreationProxy::Send(IPC::Message* msg) { | 346 bool ResourceCreationProxy::Send(IPC::Message* msg) { |
| 345 return dispatcher()->Send(msg); | 347 return dispatcher()->Send(msg); |
| 346 } | 348 } |
| 347 | 349 |
| 348 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 350 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
| 349 return false; | 351 return false; |
| 350 } | 352 } |
| 351 | 353 |
| 352 } // namespace proxy | 354 } // namespace proxy |
| 353 } // namespace ppapi | 355 } // namespace ppapi |
| OLD | NEW |