Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: ppapi/proxy/resource_creation_proxy.cc

Issue 10391101: Test for Pepper IME events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698