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

Unified Diff: chrome/common/extensions/api/extension_api.h

Issue 9460002: Convert app_bindings.js to the schema_generated_bindings.js infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/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"
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);
};

Powered by Google App Engine
This is Rietveld 408576698