Chromium Code Reviews| Index: chrome/common/extensions/api/extension_api.h |
| diff --git a/chrome/common/extensions/api/extension_api.h b/chrome/common/extensions/api/extension_api.h |
| index 25ac679f3d2bfc80a2f29edc8628102d716e271e..ea29e325c9365a2a151cc1f20d7bede57d83edef 100644 |
| --- a/chrome/common/extensions/api/extension_api.h |
| +++ b/chrome/common/extensions/api/extension_api.h |
| @@ -14,6 +14,7 @@ |
| #include "base/memory/linked_ptr.h" |
| #include "base/memory/singleton.h" |
| #include "base/values.h" |
| +#include "chrome/common/extensions/url_pattern_set.h" |
|
Aaron Boodman
2012/02/27 23:32:31
:) I love it when classes can be reused so nicely.
|
| namespace base { |
| class DictionaryValue; |
| @@ -21,6 +22,7 @@ class ListValue; |
| class Value; |
| } |
| +class GURL; |
| class Extension; |
| class ExtensionPermissionSet; |
| @@ -55,6 +57,9 @@ class ExtensionAPI { |
| // which has unprivileged components. |
| bool IsWholeAPIPrivileged(const std::string& api_name) const; |
| + // Returns whether an API matches |url|. |
| + bool MatchesURL(const std::string& api_name, const GURL& url) const; |
| + |
| // Gets a map of API name (aka namespace) to API schema. |
| const SchemaMap& schemas() { return schemas_; } |
| @@ -71,6 +76,9 @@ class ExtensionAPI { |
| // extension. |
| void GetDefaultSchemas(GetSchemasFilter filter, SchemaMap* out) const; |
| + // Gets the APIs exposed to |url|. |
| + void GetSchemasForURL(const GURL& url, SchemaMap* out) const; |
| + |
| private: |
| friend struct DefaultSingletonTraits<ExtensionAPI>; |
| @@ -113,6 +121,9 @@ class ExtensionAPI { |
| // APIs that are not entirely unprivileged, but have unprivileged components. |
| std::set<std::string> partially_unprivileged_apis_; |
| + // APIs that have URL matching permissions. |
| + std::map<std::string, URLPatternSet> url_matching_apis_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
| }; |