Chromium Code Reviews| Index: ppapi/shared_impl/input_event_impl.cc |
| diff --git a/ppapi/shared_impl/input_event_impl.cc b/ppapi/shared_impl/input_event_impl.cc |
| index 8dc653a8d3fbc581cbd292f6cc3cac0ff304a60d..5624db51f2459604134919d64bb8d4b91104aa24 100644 |
| --- a/ppapi/shared_impl/input_event_impl.cc |
| +++ b/ppapi/shared_impl/input_event_impl.cc |
| @@ -24,7 +24,11 @@ InputEventData::InputEventData() |
| wheel_ticks(PP_MakeFloatPoint(0.0f, 0.0f)), |
| wheel_scroll_by_page(false), |
| key_code(0), |
| - character_text() { |
| + character_text(), |
| + composition_segments(), |
|
yzshen1
2011/09/22 19:24:00
nit: You don't need this.
kinaba
2011/09/27 02:49:27
Done.
|
| + composition_target_segment(-1), |
| + composition_selection_start(0), |
| + composition_selection_end(0) { |
| } |
| InputEventData::~InputEventData() { |
| @@ -102,5 +106,27 @@ PP_Var InputEventImpl::GetCharacterText() { |
| data_.character_text); |
| } |
| -} // namespace ppapi |
| +uint32_t InputEventImpl::GetIMESegmentNumber() { |
| + if (data_.composition_segments.empty()) |
| + return 0; |
| + return data_.composition_segments.size() - 1; |
| +} |
| +uint32_t InputEventImpl::GetIMESegmentOffset(uint32_t index) { |
| + if (index >= data_.composition_segments.size()) |
| + return 0; |
| + return data_.composition_segments[index]; |
| +} |
| + |
| +int32_t InputEventImpl::GetIMETargetSegment() { |
| + return data_.composition_target_segment; |
| +} |
| + |
| +void InputEventImpl::GetIMESelection(uint32_t* start, uint32_t* end) { |
| + if (start) |
| + *start = data_.composition_selection_start; |
| + if (end) |
| + *end = data_.composition_selection_end; |
| +} |
| + |
| +} // namespace ppapi |