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

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

Issue 10837060: Don't show host permission warnings for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add EXPECT_TRUE Created 8 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.h
diff --git a/chrome/common/extensions/permissions/permission_set.h b/chrome/common/extensions/permissions/permission_set.h
index 4068a2f3fb4cf2b9c68bdd8c721fcba12317543b..38907f7454a0306214e8a0eff850807816d57e18 100644
--- a/chrome/common/extensions/permissions/permission_set.h
+++ b/chrome/common/extensions/permissions/permission_set.h
@@ -79,17 +79,15 @@ class PermissionSet
// HasAnyAPIPermission("tabs") will return true.
bool HasAnyAccessToAPI(const std::string& api_name) const;
- // Gets a list of the distinct hosts for displaying to the user.
- // NOTE: do not use this for comparing permissions, since this disgards some
- // information.
- std::set<std::string> GetDistinctHostsForDisplay() const;
-
// Gets the localized permission messages that represent this set.
- PermissionMessages GetPermissionMessages() const;
+ // The set of permission messages varies by extension type, hence the
+ // |extension| parameter.
+ PermissionMessages GetPermissionMessages(const Extension* extension) const;
// Gets the localized permission messages that represent this set (represented
- // as strings).
- std::vector<string16> GetWarningMessages() const;
+ // as strings). The set of permission messages varies by extension type,
+ // hence the |extension| parameter.
+ std::vector<string16> GetWarningMessages(const Extension* extension) const;
// Returns true if this is an empty set (e.g., the default permission set).
bool IsEmpty() const;
@@ -133,6 +131,15 @@ class PermissionSet
private:
FRIEND_TEST_ALL_PREFIXES(PermissionsTest, HasLessHostPrivilegesThan);
FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetWarningMessages_AudioVideo);
+ FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetDistinctHostsForDisplay);
+ FRIEND_TEST_ALL_PREFIXES(PermissionsTest,
+ GetDistinctHostsForDisplay_ComIsBestRcd);
+ FRIEND_TEST_ALL_PREFIXES(PermissionsTest,
+ GetDistinctHostsForDisplay_NetIs2ndBestRcd);
+ FRIEND_TEST_ALL_PREFIXES(PermissionsTest,
+ GetDistinctHostsForDisplay_OrgIs3rdBestRcd);
+ FRIEND_TEST_ALL_PREFIXES(PermissionsTest,
+ GetDistinctHostsForDisplay_FirstInListIs4thBestRcd);
friend class base::RefCountedThreadSafe<PermissionSet>;
~PermissionSet();
@@ -164,6 +171,11 @@ class PermissionSet
bool HasLessHostPrivilegesThan(
const PermissionSet* permissions) const;
+ // Gets a list of the distinct hosts for displaying to the user.
+ // NOTE: do not use this for comparing permissions, since this disgards some
+ // information.
+ std::set<std::string> GetDistinctHostsForDisplay() const;
+
// The api list is used when deciding if an extension can access certain
// extension APIs and features.
APIPermissionSet apis_;

Powered by Google App Engine
This is Rietveld 408576698