Chromium Code Reviews| 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> | |
|
yzshen1
2012/03/08 07:51:43
a blank line below it, please.
kinaba
2012/03/14 04:28:54
Done.
| |
| 8 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_rect.h" | 10 #include "ppapi/c/pp_rect.h" |
| 10 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
| 11 #include "ppapi/thunk/ppb_text_input_api.h" | 12 #include "ppapi/thunk/ppb_text_input_api.h" |
| 12 | 13 |
| 13 namespace ppapi { | 14 namespace ppapi { |
| 14 namespace proxy { | 15 namespace proxy { |
| 15 | 16 |
| 16 class PPB_TextInput_Proxy | 17 class PPB_TextInput_Proxy |
| 17 : public InterfaceProxy, | 18 : public InterfaceProxy, |
| 18 public ppapi::thunk::PPB_TextInput_FunctionAPI { | 19 public ppapi::thunk::PPB_TextInput_FunctionAPI { |
| 19 public: | 20 public: |
| 20 explicit PPB_TextInput_Proxy(Dispatcher* dispatcher); | 21 explicit PPB_TextInput_Proxy(Dispatcher* dispatcher); |
| 21 virtual ~PPB_TextInput_Proxy(); | 22 virtual ~PPB_TextInput_Proxy(); |
| 22 | 23 |
| 23 // FunctionGroupBase overrides. | 24 // FunctionGroupBase overrides. |
| 24 ppapi::thunk::PPB_TextInput_FunctionAPI* AsPPB_TextInput_FunctionAPI() | 25 ppapi::thunk::PPB_TextInput_FunctionAPI* AsPPB_TextInput_FunctionAPI() |
| 25 OVERRIDE; | 26 OVERRIDE; |
| 26 | 27 |
| 27 // PPB_TextInput_FunctionAPI implementation. | 28 // PPB_TextInput_FunctionAPI implementation. |
| 28 virtual void SetTextInputType(PP_Instance instance, | 29 virtual void SetTextInputType(PP_Instance instance, |
| 29 PP_TextInput_Type type) OVERRIDE; | 30 PP_TextInput_Type type) OVERRIDE; |
| 30 virtual void UpdateCaretPosition(PP_Instance instance, | 31 virtual void UpdateCaretPosition(PP_Instance instance, |
| 31 const PP_Rect& caret, | 32 const PP_Rect& caret, |
| 32 const PP_Rect& bounding_box) OVERRIDE; | 33 const PP_Rect& bounding_box) OVERRIDE; |
| 33 virtual void CancelCompositionText(PP_Instance instance) OVERRIDE; | 34 virtual void CancelCompositionText(PP_Instance instance) OVERRIDE; |
| 35 virtual void SelectionChanged(PP_Instance instance) OVERRIDE; | |
| 36 virtual void UpdateSurroundingText(PP_Instance instance, | |
| 37 const char* text, | |
| 38 uint32_t caret, | |
| 39 uint32_t anchor) OVERRIDE; | |
| 34 | 40 |
| 35 // InterfaceProxy implementation. | 41 // InterfaceProxy implementation. |
| 36 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 42 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 37 | 43 |
| 38 static const ApiID kApiID = API_ID_PPB_TEXT_INPUT; | 44 static const ApiID kApiID = API_ID_PPB_TEXT_INPUT; |
| 39 | 45 |
| 40 private: | 46 private: |
| 41 // Message handlers. | 47 // Message handlers. |
| 42 void OnMsgSetTextInputType(PP_Instance instance, PP_TextInput_Type type); | 48 void OnMsgSetTextInputType(PP_Instance instance, PP_TextInput_Type type); |
| 43 void OnMsgUpdateCaretPosition(PP_Instance instance, | 49 void OnMsgUpdateCaretPosition(PP_Instance instance, |
| 44 PP_Rect caret, | 50 PP_Rect caret, |
| 45 PP_Rect bounding_box); | 51 PP_Rect bounding_box); |
| 46 void OnMsgCancelCompositionText(PP_Instance instance); | 52 void OnMsgCancelCompositionText(PP_Instance instance); |
| 53 void OnMsgSelectionChanged(PP_Instance instance); | |
| 54 void OnMsgUpdateSurroundingText(PP_Instance instance, | |
| 55 const std::string& text, | |
| 56 uint32_t caret, | |
| 57 uint32_t anchor); | |
| 47 | 58 |
| 48 DISALLOW_COPY_AND_ASSIGN(PPB_TextInput_Proxy); | 59 DISALLOW_COPY_AND_ASSIGN(PPB_TextInput_Proxy); |
| 49 }; | 60 }; |
| 50 | 61 |
| 51 } // namespace proxy | 62 } // namespace proxy |
| 52 } // namespace ppapi | 63 } // namespace ppapi |
| 53 | 64 |
| 54 #endif // PPAPI_PROXY_PPB_TEXT_INPUT_PROXY_H_ | 65 #endif // PPAPI_PROXY_PPB_TEXT_INPUT_PROXY_H_ |
| OLD | NEW |