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

Unified Diff: ppapi/proxy/ppb_text_input_proxy.cc

Issue 8769003: Pepper IME API for surrounding text retrieval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge master. Created 8 years, 9 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/proxy/ppb_text_input_proxy.h ('k') | ppapi/proxy/ppp_text_input_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_text_input_proxy.cc
diff --git a/ppapi/proxy/ppb_text_input_proxy.cc b/ppapi/proxy/ppb_text_input_proxy.cc
index 7a489121f35d40997f5f22b07881627aee1147bb..0036e215a871f1d3b48891f69f8307c3bea87c21 100644
--- a/ppapi/proxy/ppb_text_input_proxy.cc
+++ b/ppapi/proxy/ppb_text_input_proxy.cc
@@ -42,6 +42,19 @@ void PPB_TextInput_Proxy::CancelCompositionText(PP_Instance instance) {
API_ID_PPB_TEXT_INPUT, instance));
}
+void PPB_TextInput_Proxy::SelectionChanged(PP_Instance instance) {
+ dispatcher()->Send(new PpapiHostMsg_PPBTextInput_SelectionChanged(
+ API_ID_PPB_TEXT_INPUT, instance));
+}
+
+void PPB_TextInput_Proxy::UpdateSurroundingText(PP_Instance instance,
+ const char* text,
+ uint32_t caret,
+ uint32_t anchor) {
+ dispatcher()->Send(new PpapiHostMsg_PPBTextInput_UpdateSurroundingText(
+ API_ID_PPB_TEXT_INPUT, instance, text, caret, anchor));
+}
+
bool PPB_TextInput_Proxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PPB_TextInput_Proxy, msg)
@@ -51,6 +64,10 @@ bool PPB_TextInput_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgUpdateCaretPosition)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTextInput_CancelCompositionText,
OnMsgCancelCompositionText)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTextInput_SelectionChanged,
+ OnMsgSelectionChanged)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTextInput_UpdateSurroundingText,
+ OnMsgUpdateSurroundingText)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -80,5 +97,23 @@ void PPB_TextInput_Proxy::OnMsgCancelCompositionText(PP_Instance instance) {
enter.functions()->CancelCompositionText(instance);
}
+void PPB_TextInput_Proxy::OnMsgSelectionChanged(PP_Instance instance) {
+ ppapi::thunk::EnterFunctionNoLock<PPB_TextInput_FunctionAPI> enter(instance,
+ true);
+ if (enter.succeeded())
+ enter.functions()->SelectionChanged(instance);
+}
+
+void PPB_TextInput_Proxy::OnMsgUpdateSurroundingText(PP_Instance instance,
+ const std::string& text,
+ uint32_t caret,
+ uint32_t anchor) {
+ ppapi::thunk::EnterFunctionNoLock<PPB_TextInput_FunctionAPI> enter(instance,
+ true);
+ if (enter.succeeded())
+ enter.functions()->UpdateSurroundingText(instance,
+ text.c_str(), caret, anchor);
+}
+
} // namespace proxy
} // namespace ppapi
« no previous file with comments | « ppapi/proxy/ppb_text_input_proxy.h ('k') | ppapi/proxy/ppp_text_input_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698