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
3 // found in the LICENSE file.
5 #ifndef PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "ppapi/shared_impl/resource.h"
14 #include "ppapi/thunk/ppb_device_ref_api.h"
18 // IF YOU ADD STUFF TO THIS CLASS
19 // ==============================
20 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h.
21 struct PPAPI_SHARED_EXPORT DeviceRefData
{
24 bool operator==(const DeviceRefData
& other
) const {
25 return type
== other
.type
&&
30 PP_DeviceType_Dev type
;
35 class PPAPI_SHARED_EXPORT PPB_DeviceRef_Shared
37 public thunk::PPB_DeviceRef_API
{
39 PPB_DeviceRef_Shared(ResourceObjectType type
,
41 const DeviceRefData
& data
);
43 // Resource overrides.
44 virtual PPB_DeviceRef_API
* AsPPB_DeviceRef_API() OVERRIDE
;
46 // PPB_DeviceRef_API implementation.
47 virtual const DeviceRefData
& GetDeviceRefData() const OVERRIDE
;
48 virtual PP_DeviceType_Dev
GetType() OVERRIDE
;
49 virtual PP_Var
GetName() OVERRIDE
;
51 static PP_Resource
CreateResourceArray(
52 ResourceObjectType type
,
54 const std::vector
<DeviceRefData
>& devices
);
59 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_DeviceRef_Shared
);
64 #endif // PPAPI_SHARED_IMPL_PPB_DEVICE_REF_SHARED_H_