Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/api/bluetooth/bluetooth_manifest_data.h" | 5 #include "extensions/common/api/bluetooth/bluetooth_manifest_data.h" |
| 6 | 6 |
| 7 #include "extensions/common/api/bluetooth/bluetooth_manifest_permission.h" | 7 #include "extensions/common/api/bluetooth/bluetooth_manifest_permission.h" |
| 8 #include "extensions/common/manifest_constants.h" | 8 #include "extensions/common/manifest_constants.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 } | 39 } |
| 40 | 40 |
| 41 // static | 41 // static |
| 42 bool BluetoothManifestData::CheckLowEnergyPermitted( | 42 bool BluetoothManifestData::CheckLowEnergyPermitted( |
| 43 const Extension* extension) { | 43 const Extension* extension) { |
| 44 const BluetoothManifestData* data = BluetoothManifestData::Get(extension); | 44 const BluetoothManifestData* data = BluetoothManifestData::Get(extension); |
| 45 return data && data->permission()->CheckLowEnergyPermitted(extension); | 45 return data && data->permission()->CheckLowEnergyPermitted(extension); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 bool BluetoothManifestData::CheckPeripheralPermitted( | |
| 50 const Extension* extension) { | |
| 51 const BluetoothManifestData* data = BluetoothManifestData::Get(extension); | |
| 52 return data && data->permission()->CheckLowEnergyPermitted(extension); | |
|
armansito
2015/04/21 22:48:09
Shouldn't this be:
return data && data->permissio
rkc
2015/04/27 18:39:09
Whoops.
Done.
| |
| 53 } | |
| 54 | |
| 55 // static | |
| 49 scoped_ptr<BluetoothManifestData> BluetoothManifestData::FromValue( | 56 scoped_ptr<BluetoothManifestData> BluetoothManifestData::FromValue( |
| 50 const base::Value& value, | 57 const base::Value& value, |
| 51 base::string16* error) { | 58 base::string16* error) { |
| 52 scoped_ptr<BluetoothManifestPermission> permission = | 59 scoped_ptr<BluetoothManifestPermission> permission = |
| 53 BluetoothManifestPermission::FromValue(value, error); | 60 BluetoothManifestPermission::FromValue(value, error); |
| 54 if (!permission) | 61 if (!permission) |
| 55 return scoped_ptr<BluetoothManifestData>(); | 62 return scoped_ptr<BluetoothManifestData>(); |
| 56 | 63 |
| 57 return scoped_ptr<BluetoothManifestData>( | 64 return scoped_ptr<BluetoothManifestData>( |
| 58 new BluetoothManifestData(permission.Pass())).Pass(); | 65 new BluetoothManifestData(permission.Pass())).Pass(); |
| 59 } | 66 } |
| 60 | 67 |
| 61 BluetoothPermissionRequest::BluetoothPermissionRequest( | 68 BluetoothPermissionRequest::BluetoothPermissionRequest( |
| 62 const std::string& uuid) | 69 const std::string& uuid) |
| 63 : uuid(uuid) {} | 70 : uuid(uuid) {} |
| 64 | 71 |
| 65 BluetoothPermissionRequest::~BluetoothPermissionRequest() {} | 72 BluetoothPermissionRequest::~BluetoothPermissionRequest() {} |
| 66 | 73 |
| 67 } // namespace extensions | 74 } // namespace extensions |
| OLD | NEW |