| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/thunk/enter.h" |
| 6 #include "ppapi/thunk/thunk.h" |
| 7 #include "ppapi/thunk/ppb_text_input_api.h" |
| 8 |
| 9 namespace ppapi { |
| 10 namespace thunk { |
| 11 |
| 12 namespace { |
| 13 |
| 14 void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) { |
| 15 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); |
| 16 if (enter.succeeded()) |
| 17 enter.functions()->SetTextInputType(instance, type); |
| 18 } |
| 19 |
| 20 void UpdateCaretPosition(PP_Instance instance, |
| 21 const PP_Rect* caret, |
| 22 const PP_Rect* bounding_box) { |
| 23 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); |
| 24 if (enter.succeeded() && caret && bounding_box) |
| 25 enter.functions()->UpdateCaretPosition(instance, *caret, *bounding_box); |
| 26 } |
| 27 |
| 28 void CancelCompositionText(PP_Instance instance) { |
| 29 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); |
| 30 if (enter.succeeded()) |
| 31 enter.functions()->CancelCompositionText(instance); |
| 32 } |
| 33 |
| 34 const PPB_TextInput_Dev g_ppb_textinput_thunk = { |
| 35 &SetTextInputType, |
| 36 &UpdateCaretPosition, |
| 37 &CancelCompositionText, |
| 38 }; |
| 39 |
| 40 } // namespace |
| 41 |
| 42 const PPB_TextInput_Dev* GetPPB_TextInput_Dev_Thunk() { |
| 43 return &g_ppb_textinput_thunk; |
| 44 } |
| 45 |
| 46 } // namespace thunk |
| 47 } // namespace ppapi |
| OLD | NEW |