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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 if (!has_interface<PPB_TouchInputEvent_1_0>()) | 317 if (!has_interface<PPB_TouchInputEvent_1_0>()) |
318 return 0; | 318 return 0; |
319 return get_interface<PPB_TouchInputEvent_1_0>()->GetTouchCount(pp_resource(), | 319 return get_interface<PPB_TouchInputEvent_1_0>()->GetTouchCount(pp_resource(), |
320 list); | 320 list); |
321 } | 321 } |
322 | 322 |
323 TouchPoint TouchInputEvent::GetTouchById(PP_TouchListType list, | 323 TouchPoint TouchInputEvent::GetTouchById(PP_TouchListType list, |
324 uint32_t id) const { | 324 uint32_t id) const { |
325 if (!has_interface<PPB_TouchInputEvent_1_0>()) | 325 if (!has_interface<PPB_TouchInputEvent_1_0>()) |
326 return TouchPoint(); | 326 return TouchPoint(); |
327 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()-> | 327 if (!has_interface<PPB_TouchInputEvent_1_1>()) |
bbudge
2017/05/19 22:52:47
use brackets for multiline body.
Also, the condit
jkwang
2017/05/23 04:07:44
Done.
| |
328 GetTouchById(pp_resource(), list, id)); | 328 return TouchPoint( |
329 get_interface<PPB_TouchInputEvent_1_1>()->GetTouchById(pp_resource(), | |
330 list, id), | |
331 get_interface<PPB_TouchInputEvent_1_1>()->GetTouchTiltById( | |
332 pp_resource(), list, id)); | |
333 | |
334 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->GetTouchById( | |
335 pp_resource(), list, id)); | |
329 } | 336 } |
330 | 337 |
331 TouchPoint TouchInputEvent::GetTouchByIndex(PP_TouchListType list, | 338 TouchPoint TouchInputEvent::GetTouchByIndex(PP_TouchListType list, |
332 uint32_t index) const { | 339 uint32_t index) const { |
333 if (!has_interface<PPB_TouchInputEvent_1_0>()) | 340 if (!has_interface<PPB_TouchInputEvent_1_0>()) |
334 return TouchPoint(); | 341 return TouchPoint(); |
342 if (!has_interface<PPB_TouchInputEvent_1_1>()) | |
343 return TouchPoint( | |
344 get_interface<PPB_TouchInputEvent_1_1>()->GetTouchByIndex(pp_resource(), | |
345 list, index), | |
346 get_interface<PPB_TouchInputEvent_1_1>()->GetTouchTiltByIndex( | |
347 pp_resource(), list, index)); | |
348 | |
335 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()-> | 349 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()-> |
336 GetTouchByIndex(pp_resource(), list, index)); | 350 GetTouchByIndex(pp_resource(), list, index)); |
337 } | 351 } |
338 | 352 |
339 // IMEInputEvent ------------------------------------------------------- | 353 // IMEInputEvent ------------------------------------------------------- |
340 | 354 |
341 IMEInputEvent::IMEInputEvent() : InputEvent() { | 355 IMEInputEvent::IMEInputEvent() : InputEvent() { |
342 } | 356 } |
343 | 357 |
344 IMEInputEvent::IMEInputEvent(const InputEvent& event) : InputEvent() { | 358 IMEInputEvent::IMEInputEvent(const InputEvent& event) : InputEvent() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 | 420 |
407 void IMEInputEvent::GetSelection(uint32_t* start, uint32_t* end) const { | 421 void IMEInputEvent::GetSelection(uint32_t* start, uint32_t* end) const { |
408 if (has_interface<PPB_IMEInputEvent_1_0>()) { | 422 if (has_interface<PPB_IMEInputEvent_1_0>()) { |
409 get_interface<PPB_IMEInputEvent_1_0>()->GetSelection(pp_resource(), | 423 get_interface<PPB_IMEInputEvent_1_0>()->GetSelection(pp_resource(), |
410 start, | 424 start, |
411 end); | 425 end); |
412 } | 426 } |
413 } | 427 } |
414 | 428 |
415 } // namespace pp | 429 } // namespace pp |
OLD | NEW |