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