Chromium Code Reviews| Index: chrome/common/extensions/permissions/permission_set.cc |
| diff --git a/chrome/common/extensions/permissions/permission_set.cc b/chrome/common/extensions/permissions/permission_set.cc |
| index a2980c503d02f7c276b3c19fbd30f77a9d02003a..39e32d7b6b133838e3047875540da2dd82942d4c 100644 |
| --- a/chrome/common/extensions/permissions/permission_set.cc |
| +++ b/chrome/common/extensions/permissions/permission_set.cc |
| @@ -444,7 +444,8 @@ bool PermissionSet::HasEffectiveFullAccess() const { |
| } |
| bool PermissionSet::HasLessPrivilegesThan( |
| - const PermissionSet* permissions) const { |
| + const PermissionSet* permissions, |
| + Manifest::Type extension_type) const { |
| // Things can't get worse than native code access. |
| if (HasEffectiveFullAccess()) |
| return false; |
| @@ -453,7 +454,7 @@ bool PermissionSet::HasLessPrivilegesThan( |
| if (permissions->HasEffectiveFullAccess()) |
| return true; |
| - if (HasLessHostPrivilegesThan(permissions)) |
| + if (HasLessHostPrivilegesThan(permissions, extension_type)) |
| return true; |
| if (HasLessAPIPrivilegesThan(permissions)) |
|
Jeffrey Yasskin
2013/07/09 00:32:57
Mike, are there other API privileges that we displ
miket_OOO
2013/07/09 17:12:08
None come to mind. I ran through chrome_api_permis
|
| @@ -580,7 +581,12 @@ bool PermissionSet::HasLessAPIPrivilegesThan( |
| } |
| bool PermissionSet::HasLessHostPrivilegesThan( |
| - const PermissionSet* permissions) const { |
| + const PermissionSet* permissions, |
| + Manifest::Type extension_type) const { |
| + // Platform apps host permission changes do not count as privilege increases. |
| + if (extension_type == Manifest::TYPE_PLATFORM_APP) |
| + return false; |
| + |
| // If this permission set can access any host, then it can't be elevated. |
| if (HasEffectiveAccessToAllHosts()) |
| return false; |