Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: ppapi/cpp/dev/gamepad_dev.cc

Issue 9085027: Pepper gamepad support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix example Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698