| Index: chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| index 49db41868c49f98acb4f9484eb1657e2af76b873..ecaaf2d3a784f638746c6de4cbc4e3dda96f83e2 100644
|
| --- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| +++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| @@ -44,6 +44,15 @@ class ComparablePermission {
|
| };
|
| using ComparablePermissions = std::vector<ComparablePermission>;
|
|
|
| +void DropPermissionParameter(APIPermission::ID id,
|
| + PermissionIDSet* permissions) {
|
| + if (permissions->ContainsID(id)) {
|
| + // Erase the permission, and insert it again without a parameter.
|
| + permissions->erase(id);
|
| + permissions->insert(id);
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| typedef std::set<PermissionMessage> PermissionMsgSet;
|
| @@ -176,6 +185,20 @@ bool ChromePermissionMessageProvider::IsAPIOrManifestPrivilegeIncrease(
|
| AddAPIPermissions(new_permissions, &new_ids);
|
| AddManifestPermissions(new_permissions, &new_ids);
|
|
|
| + // Ugly hack: Before M46 beta, we didn't store the parameter for settings
|
| + // override permissions in prefs (which is where |old_permissions| is coming
|
| + // from). To avoid a spurious permission increase warning, drop the parameter.
|
| + // See crbug.com/533086 and crbug.com/619759.
|
| + // TODO(treib,devlin): Remove this for M56, when hopefully all users will have
|
| + // updated prefs.
|
| + const APIPermission::ID kSettingsOverrideIDs[] = {
|
| + APIPermission::kHomepage, APIPermission::kSearchProvider,
|
| + APIPermission::kStartupPages};
|
| + for (auto id : kSettingsOverrideIDs) {
|
| + DropPermissionParameter(id, &old_ids);
|
| + DropPermissionParameter(id, &new_ids);
|
| + }
|
| +
|
| // If all the IDs were already there, it's not a privilege increase.
|
| if (old_ids.Includes(new_ids))
|
| return false;
|
|
|