| 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/input_event.h" | 5 #include "ppapi/cpp/input_event.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/instance_handle.h" | 7 #include "ppapi/cpp/instance_handle.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/point.h" | 10 #include "ppapi/cpp/point.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 PP_TimeTicks time_stamp, | 357 PP_TimeTicks time_stamp, |
| 358 const Var& text, | 358 const Var& text, |
| 359 const std::vector<uint32_t>& segment_offsets, | 359 const std::vector<uint32_t>& segment_offsets, |
| 360 int32_t target_segment, | 360 int32_t target_segment, |
| 361 const std::pair<uint32_t, uint32_t>& selection) : InputEvent() { | 361 const std::pair<uint32_t, uint32_t>& selection) : InputEvent() { |
| 362 if (!has_interface<PPB_IMEInputEvent_1_0>()) | 362 if (!has_interface<PPB_IMEInputEvent_1_0>()) |
| 363 return; | 363 return; |
| 364 uint32_t dummy = 0; | 364 uint32_t dummy = 0; |
| 365 PassRefFromConstructor(get_interface<PPB_IMEInputEvent_1_0>()->Create( | 365 PassRefFromConstructor(get_interface<PPB_IMEInputEvent_1_0>()->Create( |
| 366 instance.pp_instance(), type, time_stamp, text.pp_var(), | 366 instance.pp_instance(), type, time_stamp, text.pp_var(), |
| 367 segment_offsets.empty() ? 0 : segment_offsets.size() - 1, | 367 segment_offsets.empty() ? 0u : |
| 368 static_cast<uint32_t>(segment_offsets.size() - 1), |
| 368 segment_offsets.empty() ? &dummy : &segment_offsets[0], | 369 segment_offsets.empty() ? &dummy : &segment_offsets[0], |
| 369 target_segment, selection.first, selection.second)); | 370 target_segment, selection.first, selection.second)); |
| 370 } | 371 } |
| 371 | 372 |
| 372 | 373 |
| 373 Var IMEInputEvent::GetText() const { | 374 Var IMEInputEvent::GetText() const { |
| 374 if (has_interface<PPB_IMEInputEvent_1_0>()) { | 375 if (has_interface<PPB_IMEInputEvent_1_0>()) { |
| 375 return Var(PASS_REF, | 376 return Var(PASS_REF, |
| 376 get_interface<PPB_IMEInputEvent_1_0>()->GetText( | 377 get_interface<PPB_IMEInputEvent_1_0>()->GetText( |
| 377 pp_resource())); | 378 pp_resource())); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 405 | 406 |
| 406 void IMEInputEvent::GetSelection(uint32_t* start, uint32_t* end) const { | 407 void IMEInputEvent::GetSelection(uint32_t* start, uint32_t* end) const { |
| 407 if (has_interface<PPB_IMEInputEvent_1_0>()) { | 408 if (has_interface<PPB_IMEInputEvent_1_0>()) { |
| 408 get_interface<PPB_IMEInputEvent_1_0>()->GetSelection(pp_resource(), | 409 get_interface<PPB_IMEInputEvent_1_0>()->GetSelection(pp_resource(), |
| 409 start, | 410 start, |
| 410 end); | 411 end); |
| 411 } | 412 } |
| 412 } | 413 } |
| 413 | 414 |
| 414 } // namespace pp | 415 } // namespace pp |
| OLD | NEW |