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

Unified Diff: ppapi/thunk/ppb_text_input_thunk.cc

Issue 18671004: PPAPI: Move IMEInputEvent and TextInput to stable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing one comment Created 7 years, 5 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
« no previous file with comments | « ppapi/thunk/ppb_input_event_thunk.cc ('k') | webkit/common/plugins/ppapi/ppapi_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_text_input_thunk.cc
diff --git a/ppapi/thunk/ppb_text_input_thunk.cc b/ppapi/thunk/ppb_text_input_thunk.cc
index 7d35e2a799fbb3f8b1e1b54b14182fc49233798b..55fb4c922bde4bfd20f58270c4950289ee680ce0 100644
--- a/ppapi/thunk/ppb_text_input_thunk.cc
+++ b/ppapi/thunk/ppb_text_input_thunk.cc
@@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ppapi/c/ppb_text_input_controller.h"
+
+#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/thunk.h"
namespace ppapi {
namespace thunk {
@@ -17,7 +20,7 @@ void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) {
enter.functions()->SetTextInputType(instance, type);
}
-void UpdateCaretPosition(PP_Instance instance,
+void UpdateCaretPosition_0_2(PP_Instance instance,
const PP_Rect* caret,
const PP_Rect* bounding_box) {
EnterInstance enter(instance);
@@ -25,19 +28,37 @@ void UpdateCaretPosition(PP_Instance instance,
enter.functions()->UpdateCaretPosition(instance, *caret, *bounding_box);
}
+void UpdateCaretPosition(PP_Instance instance,
+ const PP_Rect* caret) {
+ EnterInstance enter(instance);
+ if (enter.succeeded() && caret)
+ enter.functions()->UpdateCaretPosition(instance, *caret, PP_Rect());
+}
+
void CancelCompositionText(PP_Instance instance) {
EnterInstance enter(instance);
if (enter.succeeded())
enter.functions()->CancelCompositionText(instance);
}
-void UpdateSurroundingText(PP_Instance instance, const char* text,
- uint32_t caret, uint32_t anchor) {
+void UpdateSurroundingText_0_2(PP_Instance instance, const char* text,
+ uint32_t caret, uint32_t anchor) {
EnterInstance enter(instance);
if (enter.succeeded())
enter.functions()->UpdateSurroundingText(instance, text, caret, anchor);
}
+void UpdateSurroundingText_1_0(PP_Instance instance, PP_Var text,
+ uint32_t caret, uint32_t anchor) {
+ EnterInstance enter(instance);
+ StringVar* var = StringVar::FromPPVar(text);
+ if (enter.succeeded() && var)
+ enter.functions()->UpdateSurroundingText(instance,
+ var->value().c_str(),
+ caret,
+ anchor);
+}
+
void SelectionChanged(PP_Instance instance) {
EnterInstance enter(instance);
if (enter.succeeded())
@@ -46,18 +67,25 @@ void SelectionChanged(PP_Instance instance) {
const PPB_TextInput_Dev_0_1 g_ppb_textinput_0_1_thunk = {
&SetTextInputType,
- &UpdateCaretPosition,
+ &UpdateCaretPosition_0_2,
&CancelCompositionText,
};
-const PPB_TextInput_Dev g_ppb_textinput_0_2_thunk = {
+const PPB_TextInput_Dev_0_2 g_ppb_textinput_0_2_thunk = {
&SetTextInputType,
- &UpdateCaretPosition,
+ &UpdateCaretPosition_0_2,
&CancelCompositionText,
- &UpdateSurroundingText,
+ &UpdateSurroundingText_0_2,
&SelectionChanged,
};
+const PPB_TextInputController_1_0 g_ppb_textinputcontroller_1_0_thunk = {
+ &SetTextInputType,
+ &UpdateCaretPosition,
+ &CancelCompositionText,
+ &UpdateSurroundingText_1_0,
+};
+
} // namespace
const PPB_TextInput_Dev_0_1* GetPPB_TextInput_Dev_0_1_Thunk() {
@@ -68,5 +96,9 @@ const PPB_TextInput_Dev_0_2* GetPPB_TextInput_Dev_0_2_Thunk() {
return &g_ppb_textinput_0_2_thunk;
}
+const PPB_TextInputController_1_0* GetPPB_TextInputController_1_0_Thunk() {
+ return &g_ppb_textinputcontroller_1_0_thunk;
+}
+
} // namespace thunk
} // namespace ppapi
« no previous file with comments | « ppapi/thunk/ppb_input_event_thunk.cc ('k') | webkit/common/plugins/ppapi/ppapi_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698