| 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 #include "ppapi/cpp/dev/ime_input_event_dev.h" | 5 #include "ppapi/cpp/dev/ime_input_event_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/instance.h" | 7 #include "ppapi/cpp/instance.h" |
| 8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
| 9 #include "ppapi/cpp/module_impl.h" | 9 #include "ppapi/cpp/module_impl.h" |
| 10 #include "ppapi/cpp/var.h" | 10 #include "ppapi/cpp/var.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 get_interface<PPB_IMEInputEvent_Dev>()->GetText(pp_resource())); | 42 get_interface<PPB_IMEInputEvent_Dev>()->GetText(pp_resource())); |
| 43 } | 43 } |
| 44 | 44 |
| 45 uint32_t IMEInputEvent_Dev::GetSegmentNumber() const { | 45 uint32_t IMEInputEvent_Dev::GetSegmentNumber() const { |
| 46 if (!has_interface<PPB_IMEInputEvent_Dev>()) | 46 if (!has_interface<PPB_IMEInputEvent_Dev>()) |
| 47 return 0; | 47 return 0; |
| 48 return get_interface<PPB_IMEInputEvent_Dev>()->GetSegmentNumber( | 48 return get_interface<PPB_IMEInputEvent_Dev>()->GetSegmentNumber( |
| 49 pp_resource()); | 49 pp_resource()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 std::pair<uint32_t, uint32_t> | 52 uint32_t IMEInputEvent_Dev::GetSegmentOffset(uint32_t index) const { |
| 53 IMEInputEvent_Dev::GetSegmentAt(uint32_t index) const { | |
| 54 std::pair<uint32_t, uint32_t> range(0, 0); | |
| 55 if (!has_interface<PPB_IMEInputEvent_Dev>()) | 53 if (!has_interface<PPB_IMEInputEvent_Dev>()) |
| 56 return range; | 54 return 0; |
| 57 get_interface<PPB_IMEInputEvent_Dev>()->GetSegmentAt(pp_resource(), | 55 return get_interface<PPB_IMEInputEvent_Dev>()->GetSegmentOffset(pp_resource(), |
| 58 index, | 56 index); |
| 59 &range.first, | |
| 60 &range.second); | |
| 61 return range; | |
| 62 } | 57 } |
| 63 | 58 |
| 64 int32_t IMEInputEvent_Dev::GetTargetSegment() const { | 59 int32_t IMEInputEvent_Dev::GetTargetSegment() const { |
| 65 if (!has_interface<PPB_IMEInputEvent_Dev>()) | 60 if (!has_interface<PPB_IMEInputEvent_Dev>()) |
| 66 return 0; | 61 return 0; |
| 67 return get_interface<PPB_IMEInputEvent_Dev>()->GetTargetSegment( | 62 return get_interface<PPB_IMEInputEvent_Dev>()->GetTargetSegment( |
| 68 pp_resource()); | 63 pp_resource()); |
| 69 } | 64 } |
| 70 | 65 |
| 71 std::pair<uint32_t, uint32_t> IMEInputEvent_Dev::GetSelection() const { | 66 std::pair<uint32_t, uint32_t> IMEInputEvent_Dev::GetSelection() const { |
| 72 std::pair<uint32_t, uint32_t> range(0, 0); | 67 std::pair<uint32_t, uint32_t> range(0, 0); |
| 73 if (!has_interface<PPB_IMEInputEvent_Dev>()) | 68 if (!has_interface<PPB_IMEInputEvent_Dev>()) |
| 74 return range; | 69 return range; |
| 75 get_interface<PPB_IMEInputEvent_Dev>()->GetSelection(pp_resource(), | 70 get_interface<PPB_IMEInputEvent_Dev>()->GetSelection(pp_resource(), |
| 76 &range.first, | 71 &range.first, |
| 77 &range.second); | 72 &range.second); |
| 78 return range; | 73 return range; |
| 79 } | 74 } |
| 80 | 75 |
| 81 | 76 |
| 82 } // namespace pp | 77 } // namespace pp |
| OLD | NEW |