| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_PROXY_PPB_TEXT_INPUT_PROXY_H_ | |
| 6 #define PPAPI_PROXY_PPB_TEXT_INPUT_PROXY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ppapi/c/pp_instance.h" | |
| 11 #include "ppapi/c/pp_rect.h" | |
| 12 #include "ppapi/proxy/interface_proxy.h" | |
| 13 #include "ppapi/thunk/ppb_text_input_api.h" | |
| 14 | |
| 15 namespace ppapi { | |
| 16 namespace proxy { | |
| 17 | |
| 18 class PPB_TextInput_Proxy | |
| 19 : public InterfaceProxy, | |
| 20 public ppapi::thunk::PPB_TextInput_FunctionAPI { | |
| 21 public: | |
| 22 explicit PPB_TextInput_Proxy(Dispatcher* dispatcher); | |
| 23 virtual ~PPB_TextInput_Proxy(); | |
| 24 | |
| 25 // FunctionGroupBase overrides. | |
| 26 ppapi::thunk::PPB_TextInput_FunctionAPI* AsPPB_TextInput_FunctionAPI() | |
| 27 OVERRIDE; | |
| 28 | |
| 29 // PPB_TextInput_FunctionAPI implementation. | |
| 30 virtual void SetTextInputType(PP_Instance instance, | |
| 31 PP_TextInput_Type type) OVERRIDE; | |
| 32 virtual void UpdateCaretPosition(PP_Instance instance, | |
| 33 const PP_Rect& caret, | |
| 34 const PP_Rect& bounding_box) OVERRIDE; | |
| 35 virtual void CancelCompositionText(PP_Instance instance) OVERRIDE; | |
| 36 virtual void SelectionChanged(PP_Instance instance) OVERRIDE; | |
| 37 virtual void UpdateSurroundingText(PP_Instance instance, | |
| 38 const char* text, | |
| 39 uint32_t caret, | |
| 40 uint32_t anchor) OVERRIDE; | |
| 41 | |
| 42 // InterfaceProxy implementation. | |
| 43 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | |
| 44 | |
| 45 static const ApiID kApiID = API_ID_PPB_TEXT_INPUT; | |
| 46 | |
| 47 private: | |
| 48 // Message handlers. | |
| 49 void OnMsgSetTextInputType(PP_Instance instance, PP_TextInput_Type type); | |
| 50 void OnMsgUpdateCaretPosition(PP_Instance instance, | |
| 51 PP_Rect caret, | |
| 52 PP_Rect bounding_box); | |
| 53 void OnMsgCancelCompositionText(PP_Instance instance); | |
| 54 void OnMsgUpdateSurroundingText(PP_Instance instance, | |
| 55 const std::string& text, | |
| 56 uint32_t caret, | |
| 57 uint32_t anchor); | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(PPB_TextInput_Proxy); | |
| 60 }; | |
| 61 | |
| 62 } // namespace proxy | |
| 63 } // namespace ppapi | |
| 64 | |
| 65 #endif // PPAPI_PROXY_PPB_TEXT_INPUT_PROXY_H_ | |
| OLD | NEW |