Chromium Code Reviews| Index: webkit/plugins/ppapi/resource_creation_impl.cc |
| diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc |
| index 17ef13b6fd004304406504b8276cd0d4e7535ebc..fd25505a960e28d5e61d239328982e76b796bd4e 100644 |
| --- a/webkit/plugins/ppapi/resource_creation_impl.cc |
| +++ b/webkit/plugins/ppapi/resource_creation_impl.cc |
| @@ -182,6 +182,43 @@ PP_Resource ResourceCreationImpl::CreateImageData(PP_Instance instance, |
| return PPB_ImageData_Impl::Create(instance, format, size, init_to_zero); |
| } |
| +PP_Resource ResourceCreationImpl::CreateIMEInputEvent( |
| + PP_Instance instance, |
| + PP_InputEvent_Type type, |
| + PP_TimeTicks time_stamp, |
| + struct PP_Var text, |
| + uint32_t segment_number, |
| + const uint32_t* segment_offsets, |
| + int32_t target_segment, |
| + uint32_t selection_start, |
| + uint32_t selection_end) { |
| + if (type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_START && |
|
yzshen1
2012/05/15 18:03:48
Please put the implementation in ppb_input_event_s
kinaba
2012/05/16 10:13:57
Done. I also did the refactoring for other input e
yzshen1
2012/05/16 20:33:28
I don't know of any reason not to do that.
Thanks!
|
| + type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE && |
| + type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_END && |
| + type != PP_INPUTEVENT_TYPE_IME_TEXT) |
| + return 0; |
| + |
| + InputEventData data; |
| + data.event_type = type; |
| + data.event_time_stamp = time_stamp; |
| + if (text.type == PP_VARTYPE_STRING) { |
| + StringVar* text_str = StringVar::FromPPVar(text); |
| + if (!text_str) |
| + return 0; |
| + data.character_text = text_str->value(); |
| + } |
| + data.composition_target_segment = target_segment; |
| + if (segment_number != 0) { |
| + data.composition_segment_offsets.assign(&segment_offsets[0], |
| + &segment_offsets[segment_number+1]); |
| + } |
| + data.composition_selection_start = selection_start; |
| + data.composition_selection_end = selection_end; |
| + |
| + return (new PPB_InputEvent_Shared(::ppapi::OBJECT_IS_IMPL, |
| + instance, data))->GetReference(); |
| +} |
| + |
| PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent( |
| PP_Instance instance, |
| PP_InputEvent_Type type, |