| Index: ppapi/thunk/ppb_input_event_thunk.cc
|
| diff --git a/ppapi/thunk/ppb_input_event_thunk.cc b/ppapi/thunk/ppb_input_event_thunk.cc
|
| index bd28495a90ac3926605c3a600cc4e04fe464558e..8cf20a0576a77b0f8c9848c23afd6cc37a202539 100644
|
| --- a/ppapi/thunk/ppb_input_event_thunk.cc
|
| +++ b/ppapi/thunk/ppb_input_event_thunk.cc
|
| @@ -271,6 +271,45 @@ const PPB_KeyboardInputEvent g_ppb_keyboard_input_event_thunk = {
|
| &GetCharacterText
|
| };
|
|
|
| +// Keyboard --------------------------------------------------------------------
|
| +
|
| +PP_Bool IsCompositionInputEvent(PP_Resource resource) {
|
| + if (!IsInputEvent(resource))
|
| + return PP_FALSE; // Prevent warning log in GetType.
|
| + PP_InputEvent_Type type = GetType(resource);
|
| + return PP_FromBool(type == PP_INPUTEVENT_TYPE_COMPOSITION_START ||
|
| + type == PP_INPUTEVENT_TYPE_COMPOSITION_UPDATE ||
|
| + type == PP_INPUTEVENT_TYPE_COMPOSITION_END ||
|
| + type == PP_INPUTEVENT_TYPE_IME_TEXT);
|
| +}
|
| +
|
| +PP_Var GetCompositionText(PP_Resource composition_event) {
|
| + return GetCharacterText(composition_event);
|
| +}
|
| +
|
| +uint32_t GetCompositionTargetSegment(PP_Resource composition_event) {
|
| + EnterInputEvent enter(composition_event, true);
|
| + if (enter.failed())
|
| + return 0;
|
| + return enter.object()->GetCompositionTargetSegment();
|
| +}
|
| +
|
| +void GetCompositionSegments(PP_Resource composition_event,
|
| + uint32_t** segments,
|
| + uint32_t* size) {
|
| + EnterInputEvent enter(composition_event, true);
|
| + if (enter.failed())
|
| + return;
|
| + enter.object()->GetCompositionSegments(segments, size);
|
| +}
|
| +
|
| +const PPB_CompositionInputEvent g_ppb_composition_input_event_thunk = {
|
| + &IsCompositionInputEvent,
|
| + &GetCompositionText,
|
| + &GetCompositionTargetSegment,
|
| + &GetCompositionSegments,
|
| +};
|
| +
|
| } // namespace
|
|
|
| const PPB_InputEvent* GetPPB_InputEvent_Thunk() {
|
| @@ -293,5 +332,9 @@ const PPB_WheelInputEvent* GetPPB_WheelInputEvent_Thunk() {
|
| return &g_ppb_wheel_input_event_thunk;
|
| }
|
|
|
| +const PPB_CompositionInputEvent* GetPPB_CompositionInputEvent_Thunk() {
|
| + return &g_ppb_composition_input_event_thunk;
|
| +}
|
| +
|
| } // namespace thunk
|
| } // namespace ppapi
|
|
|