| Index: extensions/common/permissions/media_galleries_permission.cc
|
| diff --git a/extensions/common/permissions/media_galleries_permission.cc b/extensions/common/permissions/media_galleries_permission.cc
|
| index 864d13ee71efd1636d78fb8086313675b66475ee..1b3b9198f60c109724a829c72f67c80348f460e5 100644
|
| --- a/extensions/common/permissions/media_galleries_permission.cc
|
| +++ b/extensions/common/permissions/media_galleries_permission.cc
|
| @@ -38,12 +38,10 @@ bool IsValidPermissionSet(bool has_read, bool has_copy_to, bool has_delete,
|
| return true;
|
| }
|
|
|
| -// Adds the permissions from the |data_set| to the permission lists that are
|
| -// not NULL. If NULL, that list is ignored.
|
| +// Adds the permissions from the |data_set| to |ids|.
|
| void AddPermissionsToLists(
|
| const std::set<MediaGalleriesPermissionData>& data_set,
|
| - PermissionIDSet* ids,
|
| - PermissionMessages* messages) {
|
| + PermissionIDSet* ids) {
|
| // TODO(sashab): Once GetMessages() is deprecated, move this logic back into
|
| // GetPermissions().
|
| bool has_all_auto_detected = false;
|
| @@ -80,38 +78,16 @@ void AddPermissionsToLists(
|
|
|
| // Separate PermissionMessage IDs for read, copyTo, and delete. Otherwise an
|
| // extension can silently gain new access capabilities.
|
| - if (messages) {
|
| - messages->push_back(PermissionMessage(
|
| - PermissionMessage::kMediaGalleriesAllGalleriesRead,
|
| - l10n_util::GetStringUTF16(
|
| - IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_READ)));
|
| - }
|
| - if (ids)
|
| - ids->insert(APIPermission::kMediaGalleriesAllGalleriesRead);
|
| + ids->insert(APIPermission::kMediaGalleriesAllGalleriesRead);
|
|
|
| // For copyTo and delete, the proper combined permission message will be
|
| // derived in ChromePermissionMessageProvider::GetWarningMessages(), such
|
| // that the user get 1 entry for all media galleries access permissions,
|
| // rather than several separate entries.
|
| - if (has_copy_to) {
|
| - if (messages) {
|
| - messages->push_back(PermissionMessage(
|
| - PermissionMessage::kMediaGalleriesAllGalleriesCopyTo,
|
| - base::string16()));
|
| - }
|
| - if (ids)
|
| - ids->insert(APIPermission::kMediaGalleriesAllGalleriesCopyTo);
|
| - }
|
| - if (has_delete) {
|
| - if (messages) {
|
| - messages->push_back(PermissionMessage(
|
| - PermissionMessage::kMediaGalleriesAllGalleriesDelete,
|
| - base::string16()));
|
| - }
|
| - if (ids)
|
| - ids->insert(APIPermission::kMediaGalleriesAllGalleriesDelete);
|
| - }
|
| - return;
|
| + if (has_copy_to)
|
| + ids->insert(APIPermission::kMediaGalleriesAllGalleriesCopyTo);
|
| + if (has_delete)
|
| + ids->insert(APIPermission::kMediaGalleriesAllGalleriesDelete);
|
| }
|
|
|
| } // namespace
|
| @@ -188,7 +164,7 @@ bool MediaGalleriesPermission::FromValue(
|
|
|
| PermissionIDSet MediaGalleriesPermission::GetPermissions() const {
|
| PermissionIDSet result;
|
| - AddPermissionsToLists(data_set_, &result, NULL);
|
| + AddPermissionsToLists(data_set_, &result);
|
| return result;
|
| }
|
|
|
|
|