| 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/cpp/dev/text_input_dev.h" |
| 6 |
| 7 #include "ppapi/cpp/instance.h" |
| 8 #include "ppapi/cpp/module_impl.h" |
| 9 #include "ppapi/cpp/rect.h" |
| 10 |
| 11 namespace pp { |
| 12 |
| 13 namespace { |
| 14 |
| 15 template <> const char* interface_name<PPB_TextInput_Dev>() { |
| 16 return PPB_TEXTINPUT_DEV_INTERFACE; |
| 17 } |
| 18 |
| 19 } // namespace |
| 20 |
| 21 |
| 22 TextInput_Dev::TextInput_Dev(Instance* instance) : instance_(instance) { |
| 23 } |
| 24 |
| 25 TextInput_Dev::~TextInput_Dev() { |
| 26 } |
| 27 |
| 28 void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) { |
| 29 if (!has_interface<PPB_TextInput_Dev>()) |
| 30 return; |
| 31 get_interface<PPB_TextInput_Dev>()->SetTextInputType( |
| 32 instance_->pp_instance(), type); |
| 33 } |
| 34 |
| 35 void TextInput_Dev::UpdateCaretPosition(const Rect& caret, |
| 36 const Rect& boundingBox) { |
| 37 if (!has_interface<PPB_TextInput_Dev>()) |
| 38 return; |
| 39 get_interface<PPB_TextInput_Dev>()->UpdateCaretPosition( |
| 40 instance_->pp_instance(), &caret.pp_rect(), &boundingBox.pp_rect()); |
| 41 } |
| 42 |
| 43 void TextInput_Dev::ConfirmCompositionText() { |
| 44 if (!has_interface<PPB_TextInput_Dev>()) |
| 45 return; |
| 46 get_interface<PPB_TextInput_Dev>()->ConfirmCompositionText( |
| 47 instance_->pp_instance()); |
| 48 } |
| 49 |
| 50 void TextInput_Dev::CancelCompositionText() { |
| 51 if (!has_interface<PPB_TextInput_Dev>()) |
| 52 return; |
| 53 get_interface<PPB_TextInput_Dev>()->CancelCompositionText( |
| 54 instance_->pp_instance()); |
| 55 } |
| 56 |
| 57 } // namespace pp |
| OLD | NEW |