| 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 #ifndef EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ | 5 #ifndef EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ |
| 6 #define EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ | 6 #define EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Tries to construct the info based on |value|, as it would have appeared in | 30 // Tries to construct the info based on |value|, as it would have appeared in |
| 31 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. | 31 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. |
| 32 static scoped_ptr<BluetoothManifestPermission> FromValue( | 32 static scoped_ptr<BluetoothManifestPermission> FromValue( |
| 33 const base::Value& value, | 33 const base::Value& value, |
| 34 base::string16* error); | 34 base::string16* error); |
| 35 | 35 |
| 36 bool CheckRequest(const Extension* extension, | 36 bool CheckRequest(const Extension* extension, |
| 37 const BluetoothPermissionRequest& request) const; | 37 const BluetoothPermissionRequest& request) const; |
| 38 bool CheckSocketPermitted(const Extension* extension) const; | 38 bool CheckSocketPermitted(const Extension* extension) const; |
| 39 bool CheckLowEnergyPermitted(const Extension* extension) const; | 39 bool CheckLowEnergyPermitted(const Extension* extension) const; |
| 40 bool CheckPeripheralPermitted(const Extension* extension) const; |
| 40 | 41 |
| 41 void AddPermission(const std::string& uuid); | 42 void AddPermission(const std::string& uuid); |
| 42 | 43 |
| 43 // extensions::ManifestPermission overrides. | 44 // extensions::ManifestPermission overrides. |
| 44 std::string name() const override; | 45 std::string name() const override; |
| 45 std::string id() const override; | 46 std::string id() const override; |
| 46 PermissionIDSet GetPermissions() const override; | 47 PermissionIDSet GetPermissions() const override; |
| 47 bool HasMessages() const override; | 48 bool HasMessages() const override; |
| 48 PermissionMessages GetMessages() const override; | 49 PermissionMessages GetMessages() const override; |
| 49 bool FromValue(const base::Value* value) override; | 50 bool FromValue(const base::Value* value) override; |
| 50 scoped_ptr<base::Value> ToValue() const override; | 51 scoped_ptr<base::Value> ToValue() const override; |
| 51 ManifestPermission* Diff(const ManifestPermission* rhs) const override; | 52 ManifestPermission* Diff(const ManifestPermission* rhs) const override; |
| 52 ManifestPermission* Union(const ManifestPermission* rhs) const override; | 53 ManifestPermission* Union(const ManifestPermission* rhs) const override; |
| 53 ManifestPermission* Intersect(const ManifestPermission* rhs) const override; | 54 ManifestPermission* Intersect(const ManifestPermission* rhs) const override; |
| 54 | 55 |
| 55 const BluetoothUuidSet& uuids() const { | 56 const BluetoothUuidSet& uuids() const { |
| 56 return uuids_; | 57 return uuids_; |
| 57 } | 58 } |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 BluetoothUuidSet uuids_; | 61 BluetoothUuidSet uuids_; |
| 61 bool socket_; | 62 bool socket_; |
| 62 bool low_energy_; | 63 bool low_energy_; |
| 64 bool peripheral_; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace extensions | 67 } // namespace extensions |
| 66 | 68 |
| 67 #endif // EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ | 69 #endif // EXTENSIONS_COMMON_API_BLUETOOTH_BLUETOOTH_MANIFEST_PERMISSION_H_ |
| OLD | NEW |