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 |