Index: ppapi/proxy/resource_creation_proxy.cc |
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc |
index de5373548ef34f78e19163cc8cc2d034a43ebd7e..461d9bc6a4ff090e51caeef5f9f0061ef45fd126 100644 |
--- a/ppapi/proxy/resource_creation_proxy.cc |
+++ b/ppapi/proxy/resource_creation_proxy.cc |
@@ -76,6 +76,43 @@ PP_Resource ResourceCreationProxy::CreateFileSystem( |
return PPB_FileSystem_Proxy::CreateProxyResource(instance, type); |
} |
+PP_Resource ResourceCreationProxy::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 && |
+ 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]); |
yzshen1
2012/05/15 18:03:48
spaces around '+', please.
kinaba
2012/05/16 10:13:57
Done.
|
+ } |
+ data.composition_selection_start = selection_start; |
+ data.composition_selection_end = selection_end; |
+ |
+ return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, |
+ instance, data))->GetReference(); |
+} |
+ |
PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( |
PP_Instance instance, |
PP_InputEvent_Type type, |