This source file includes following definitions.
- Get
- CheckRequest
- FromValue
#include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_data.h"
#include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.h"
#include "extensions/common/manifest_constants.h"
namespace extensions {
BluetoothManifestData::BluetoothManifestData(
scoped_ptr<BluetoothManifestPermission> permission)
: permission_(permission.Pass()) {
DCHECK(permission_);
}
BluetoothManifestData::~BluetoothManifestData() {}
BluetoothManifestData* BluetoothManifestData::Get(const Extension* extension) {
return static_cast<BluetoothManifestData*>(
extension->GetManifestData(manifest_keys::kBluetooth));
}
bool BluetoothManifestData::CheckRequest(
const Extension* extension,
const BluetoothPermissionRequest& request) {
const BluetoothManifestData* data = BluetoothManifestData::Get(extension);
return data && data->permission()->CheckRequest(extension, request);
}
scoped_ptr<BluetoothManifestData> BluetoothManifestData::FromValue(
const base::Value& value,
base::string16* error) {
scoped_ptr<BluetoothManifestPermission> permission =
BluetoothManifestPermission::FromValue(value, error);
if (!permission)
return scoped_ptr<BluetoothManifestData>();
return scoped_ptr<BluetoothManifestData>(
new BluetoothManifestData(permission.Pass())).Pass();
}
BluetoothPermissionRequest::BluetoothPermissionRequest(
const std::string& uuid)
: uuid(uuid) {}
BluetoothPermissionRequest::~BluetoothPermissionRequest() {}
}