| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (is_ime_event) { | 45 if (is_ime_event) { |
| 46 Module::Get()->core()->AddRefResource(event.pp_resource()); | 46 Module::Get()->core()->AddRefResource(event.pp_resource()); |
| 47 PassRefFromConstructor(event.pp_resource()); | 47 PassRefFromConstructor(event.pp_resource()); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 IMEInputEvent_Dev::IMEInputEvent_Dev( | 51 IMEInputEvent_Dev::IMEInputEvent_Dev( |
| 52 const InstanceHandle& instance, | 52 const InstanceHandle& instance, |
| 53 PP_InputEvent_Type type, | 53 PP_InputEvent_Type type, |
| 54 PP_TimeTicks time_stamp, | 54 PP_TimeTicks time_stamp, |
| 55 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() ? 0 : segment_offsets.size() - 1, |
| 65 segment_offsets.empty() ? &dummy : &segment_offsets[0], | 65 segment_offsets.empty() ? &dummy : &segment_offsets[0], |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } else if (has_interface<PPB_IMEInputEvent_Dev_0_1>()) { | 122 } else if (has_interface<PPB_IMEInputEvent_Dev_0_1>()) { |
| 123 get_interface<PPB_IMEInputEvent_Dev_0_1>()->GetSelection(pp_resource(), | 123 get_interface<PPB_IMEInputEvent_Dev_0_1>()->GetSelection(pp_resource(), |
| 124 &range.first, | 124 &range.first, |
| 125 &range.second); | 125 &range.second); |
| 126 } | 126 } |
| 127 return range; | 127 return range; |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 } // namespace pp | 131 } // namespace pp |
| OLD | NEW |