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