| 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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
| 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
| 9 #include "ppapi/shared_impl/private/ppb_font_shared.h" | 9 #include "ppapi/shared_impl/private/ppb_font_shared.h" |
| 10 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 10 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 PP_Bool init_to_zero) { | 183 PP_Bool init_to_zero) { |
| 184 return PPB_ImageData_Impl::Create(instance, format, size, init_to_zero); | 184 return PPB_ImageData_Impl::Create(instance, format, size, init_to_zero); |
| 185 } | 185 } |
| 186 | 186 |
| 187 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent( | 187 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent( |
| 188 PP_Instance instance, | 188 PP_Instance instance, |
| 189 PP_InputEvent_Type type, | 189 PP_InputEvent_Type type, |
| 190 PP_TimeTicks time_stamp, | 190 PP_TimeTicks time_stamp, |
| 191 uint32_t modifiers, | 191 uint32_t modifiers, |
| 192 uint32_t key_code, | 192 uint32_t key_code, |
| 193 uint32_t usb_scan_code, |
| 193 struct PP_Var character_text) { | 194 struct PP_Var character_text) { |
| 194 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && | 195 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && |
| 195 type != PP_INPUTEVENT_TYPE_KEYDOWN && | 196 type != PP_INPUTEVENT_TYPE_KEYDOWN && |
| 196 type != PP_INPUTEVENT_TYPE_KEYUP && | 197 type != PP_INPUTEVENT_TYPE_KEYUP && |
| 197 type != PP_INPUTEVENT_TYPE_CHAR) | 198 type != PP_INPUTEVENT_TYPE_CHAR) |
| 198 return 0; | 199 return 0; |
| 199 | 200 |
| 200 InputEventData data; | 201 InputEventData data; |
| 201 data.event_type = type; | 202 data.event_type = type; |
| 202 data.event_time_stamp = time_stamp; | 203 data.event_time_stamp = time_stamp; |
| 203 data.event_modifiers = modifiers; | 204 data.event_modifiers = modifiers; |
| 204 data.key_code = key_code; | 205 data.key_code = key_code; |
| 206 data.usb_scan_code = usb_scan_code; |
| 205 if (character_text.type == PP_VARTYPE_STRING) { | 207 if (character_text.type == PP_VARTYPE_STRING) { |
| 206 StringVar* string_var = StringVar::FromPPVar(character_text); | 208 StringVar* string_var = StringVar::FromPPVar(character_text); |
| 207 if (!string_var) | 209 if (!string_var) |
| 208 return 0; | 210 return 0; |
| 209 data.character_text = string_var->value(); | 211 data.character_text = string_var->value(); |
| 210 } | 212 } |
| 211 | 213 |
| 212 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), | 214 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), |
| 213 instance, data))->GetReference(); | 215 instance, data))->GetReference(); |
| 214 } | 216 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 data.wheel_delta = *wheel_delta; | 324 data.wheel_delta = *wheel_delta; |
| 323 data.wheel_ticks = *wheel_ticks; | 325 data.wheel_ticks = *wheel_ticks; |
| 324 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); | 326 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); |
| 325 | 327 |
| 326 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), | 328 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), |
| 327 instance, data))->GetReference(); | 329 instance, data))->GetReference(); |
| 328 } | 330 } |
| 329 | 331 |
| 330 } // namespace ppapi | 332 } // namespace ppapi |
| 331 } // namespace webkit | 333 } // namespace webkit |
| OLD | NEW |