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

Unified Diff: ppapi/thunk/ppb_input_event_thunk.cc

Issue 7621010: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot Created 9 years, 3 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/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

Powered by Google App Engine
This is Rietveld 408576698