diff options
Diffstat (limited to 'extensions/common/permissions/usb_device_permission.cc')
-rw-r--r-- | extensions/common/permissions/usb_device_permission.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extensions/common/permissions/usb_device_permission.cc b/extensions/common/permissions/usb_device_permission.cc index ab279b6..fd94783 100644 --- a/extensions/common/permissions/usb_device_permission.cc +++ b/extensions/common/permissions/usb_device_permission.cc @@ -25,6 +25,21 @@ UsbDevicePermission::UsbDevicePermission(const APIPermissionInfo* info) UsbDevicePermission::~UsbDevicePermission() {} +bool UsbDevicePermission::FromValue( + const base::Value* value, + std::string* error, + std::vector<std::string>* unhandled_permissions) { + bool parsed_ok = + SetDisjunctionPermission<UsbDevicePermissionData, UsbDevicePermission>:: + FromValue(value, error, unhandled_permissions); + if (parsed_ok && data_set_.empty()) { + if (error) + *error = "NULL or empty permission list"; + return false; + } + return parsed_ok; +} + PermissionIDSet UsbDevicePermission::GetPermissions() const { PermissionIDSet ids; |