Added CoalescedPermissionMessages to ManifestPermissions
Added a new type, CoalescedPermissionMessage, which represents a
permission message made up of 0 or more permissions. Also started a
refactor to move IDs out of APIPermission::ID and PermissionMessage::ID
and into their own common class.
Added a new method GetPermissions() to ManifestPermission, which allows
manifest permissions to specify their own custom permissions (and hence
custom messages) for apps with that permission. Updated all 5 subclasses
(automation, bluetooth, sockets, UI overrides hanlder and the mock
manifest).
Also added another FilterHostPermissions() method to ExtensionsClient
that can create CoalescedPermissionMessages.
BUG=398257
Committed: https://crrev.com/45d827a6ba247ef55275c52ade2dfddbaeb87a9f
Cr-Commit-Position: refs/heads/master@{#307630}
Review URL: https://codereview.chromium.org/750353003
Cr-Commit-Position: refs/heads/master@{#307677}
diff --git a/extensions/common/extensions_client.h b/extensions/common/extensions_client.h
index f2292b1..bfe67ca 100644
--- a/extensions/common/extensions_client.h
+++ b/extensions/common/extensions_client.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
+#include "extensions/common/permissions/api_permission_set.h"
class GURL;
@@ -66,11 +67,21 @@
// Takes the list of all hosts and filters out those with special
// permission strings. Adds the regular hosts to |new_hosts|,
// and adds the special permission messages to |messages|.
+ // TODO(sashab): Deprecate this in favour of FilterHostPermissions() below.
virtual void FilterHostPermissions(
const URLPatternSet& hosts,
URLPatternSet* new_hosts,
std::set<PermissionMessage>* messages) const = 0;
+ // Takes the list of all hosts and filters out those with special
+ // permission strings. Adds the regular hosts to |new_hosts|,
+ // and adds any additional permissions to |permissions|.
+ // TODO(sashab): Split this function in two: One to filter out ignored host
+ // permissions, and one to get permissions for the given hosts.
+ virtual void FilterHostPermissions(const URLPatternSet& hosts,
+ URLPatternSet* new_hosts,
+ PermissionIDSet* permissions) const = 0;
+
// Replaces the scripting whitelist with |whitelist|. Used in the renderer;
// only used for testing in the browser process.
virtual void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) = 0;