introduce a permission without sub-permissions in mediaGalleries API
We use mediaGalleries.getMetadata API to fetch media metadata in our Files.app(Chrome OS FileManager).
We pass the blob object(~binary data) to the API,
so we don't need any permissions.
This API has "read" permission, but this permission means "reading files in the MediaGallery", but we don't read it - the blob objects we pass is from filesystem, not from MediaGallery.
We need "empty" permissions, but if we pass a empty list as permissions, it causes permission error and the app doesn't start at all.
In this patch, I introduce a permission without sub-permissions,
and you can specify this permission in a manifest file like:
> "mediaGalleries",
https://developer.chrome.com/apps/mediaGalleries
BUG=581614
Review URL: https://codereview.chromium.org/1643183002
Cr-Commit-Position: refs/heads/master@{#375400}
diff --git a/extensions/common/permissions/usb_device_permission.h b/extensions/common/permissions/usb_device_permission.h
index 7cba580..2658011 100644
--- a/extensions/common/permissions/usb_device_permission.h
+++ b/extensions/common/permissions/usb_device_permission.h
@@ -30,6 +30,11 @@
explicit UsbDevicePermission(const APIPermissionInfo* info);
~UsbDevicePermission() override;
+ // SetDisjunctionPermission overrides.
+ bool FromValue(const base::Value* value,
+ std::string* error,
+ std::vector<std::string>* unhandled_permissions) override;
+
// APIPermission overrides
PermissionIDSet GetPermissions() const override;
};