| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/cpp/dev/gamepad_dev.h" |
| 6 |
| 7 #include "ppapi/c/dev/ppb_gamepad_dev.h" |
| 8 #include "ppapi/cpp/instance.h" |
| 9 #include "ppapi/cpp/module.h" |
| 10 #include "ppapi/cpp/module_impl.h" |
| 11 |
| 12 namespace pp { |
| 13 |
| 14 namespace { |
| 15 |
| 16 template <> const char* interface_name<PPB_Gamepad_Dev>() { |
| 17 return PPB_GAMEPAD_DEV_INTERFACE; |
| 18 } |
| 19 |
| 20 } // namespace |
| 21 |
| 22 Gamepad::Gamepad(Instance* instance) |
| 23 : instance_(instance) { |
| 24 } |
| 25 |
| 26 Gamepad::~Gamepad() { |
| 27 } |
| 28 |
| 29 bool Gamepad::SampleGamepads(PP_GamepadsData_Dev* data) { |
| 30 if (!has_interface<PPB_Gamepad_Dev>()) |
| 31 return false; |
| 32 get_interface<PPB_Gamepad_Dev>()->SampleGamepads( |
| 33 instance_->pp_instance(), data); |
| 34 return true; |
| 35 } |
| 36 |
| 37 } // namespace pp |
| OLD | NEW |