Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2593)

Unified Diff: chrome/common/extensions/permissions/permission_set.cc

Issue 18399007: Don't count host permission changes for v2 apps as a permission increase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/common/extensions/permissions/permission_set.h ('k') | chrome/common/extensions/permissions/permission_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698