1 // Copyright 2013 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 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_BLUETOOTH_PERMISSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_BLUETOOTH_PERMISSION_H_ 7 8 #include <string> 9 10 #include "chrome/common/extensions/permissions/bluetooth_permission_data.h" 11 #include "chrome/common/extensions/permissions/set_disjunction_permission.h" 12 #include "extensions/common/permissions/api_permission.h" 13 14 namespace extensions { 15 16 // BluetoothPermission represents the permission to implement a specific 17 // Bluetooth Profile. 18 class BluetoothPermission 19 : public SetDisjunctionPermission<BluetoothPermissionData, 20 BluetoothPermission> { 21 public: 22 // A Bluetooth profile uuid that should be checked for permission to access. 23 struct CheckParam : APIPermission::CheckParam { CheckParamCheckParam24 explicit CheckParam(std::string uuid) 25 : uuid(uuid) {} 26 const std::string uuid; 27 }; 28 29 explicit BluetoothPermission(const APIPermissionInfo* info); 30 virtual ~BluetoothPermission(); 31 32 // SetDisjunctionPermission overrides. 33 // BluetoothPermission permits an empty list for gaining permission to the 34 // Bluetooth APIs without implementing a profile. 35 virtual bool FromValue(const base::Value* value) OVERRIDE; 36 37 // APIPermission overrides 38 virtual PermissionMessages GetMessages() const OVERRIDE; 39 }; 40 41 } // namespace extensions 42 43 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_BLUETOOTH_PERMISSION_H_ 44