OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 PP_TimeTicks time_stamp, | 54 PP_TimeTicks time_stamp, |
55 const Var& text, | 55 const Var& text, |
56 const std::vector<uint32_t>& segment_offsets, | 56 const std::vector<uint32_t>& segment_offsets, |
57 int32_t target_segment, | 57 int32_t target_segment, |
58 const std::pair<uint32_t, uint32_t>& selection) : InputEvent() { | 58 const std::pair<uint32_t, uint32_t>& selection) : InputEvent() { |
59 if (!has_interface<PPB_IMEInputEvent_Dev_0_2>()) | 59 if (!has_interface<PPB_IMEInputEvent_Dev_0_2>()) |
60 return; | 60 return; |
61 uint32_t dummy = 0; | 61 uint32_t dummy = 0; |
62 PassRefFromConstructor(get_interface<PPB_IMEInputEvent_Dev_0_2>()->Create( | 62 PassRefFromConstructor(get_interface<PPB_IMEInputEvent_Dev_0_2>()->Create( |
63 instance.pp_instance(), type, time_stamp, text.pp_var(), | 63 instance.pp_instance(), type, time_stamp, text.pp_var(), |
64 segment_offsets.empty() ? 0 : segment_offsets.size() - 1, | 64 segment_offsets.empty() ? 0u : |
| 65 static_cast<uint32_t>(segment_offsets.size() - 1), |
65 segment_offsets.empty() ? &dummy : &segment_offsets[0], | 66 segment_offsets.empty() ? &dummy : &segment_offsets[0], |
66 target_segment, selection.first, selection.second)); | 67 target_segment, selection.first, selection.second)); |
67 } | 68 } |
68 | 69 |
69 | 70 |
70 Var IMEInputEvent_Dev::GetText() const { | 71 Var IMEInputEvent_Dev::GetText() const { |
71 if (has_interface<PPB_IMEInputEvent_Dev_0_2>()) { | 72 if (has_interface<PPB_IMEInputEvent_Dev_0_2>()) { |
72 return Var(PASS_REF, | 73 return Var(PASS_REF, |
73 get_interface<PPB_IMEInputEvent_Dev_0_2>()->GetText( | 74 get_interface<PPB_IMEInputEvent_Dev_0_2>()->GetText( |
74 pp_resource())); | 75 pp_resource())); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } else if (has_interface<PPB_IMEInputEvent_Dev_0_1>()) { | 123 } else if (has_interface<PPB_IMEInputEvent_Dev_0_1>()) { |
123 get_interface<PPB_IMEInputEvent_Dev_0_1>()->GetSelection(pp_resource(), | 124 get_interface<PPB_IMEInputEvent_Dev_0_1>()->GetSelection(pp_resource(), |
124 &range.first, | 125 &range.first, |
125 &range.second); | 126 &range.second); |
126 } | 127 } |
127 return range; | 128 return range; |
128 } | 129 } |
129 | 130 |
130 | 131 |
131 } // namespace pp | 132 } // namespace pp |
OLD | NEW |