OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_COMMON_EXTENSION_API_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_API_H_ |
6 #define EXTENSIONS_COMMON_EXTENSION_API_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool IsAnyFeatureAvailableToContext(const Feature& api, | 102 bool IsAnyFeatureAvailableToContext(const Feature& api, |
103 const Extension* extension, | 103 const Extension* extension, |
104 Feature::Context context, | 104 Feature::Context context, |
105 const GURL& url); | 105 const GURL& url); |
106 | 106 |
107 // Returns true if |name| is available to |extension| in any untrusted | 107 // Returns true if |name| is available to |extension| in any untrusted |
108 // extension context, such as content scripts, iframes, or web pages. | 108 // extension context, such as content scripts, iframes, or web pages. |
109 bool IsAvailableInUntrustedContext(const std::string& name, | 109 bool IsAvailableInUntrustedContext(const std::string& name, |
110 const Extension* extension); | 110 const Extension* extension); |
111 | 111 |
112 // Returns true if |name| is available to webui contexts. | 112 // Returns true if |name| is available to WebUI contexts on |url|. |
113 bool IsAvailableToWebUI(const std::string& name); | 113 bool IsAvailableToWebUI(const std::string& name, const GURL& url); |
114 | 114 |
115 // Gets the schema for the extension API with namespace |full_name|. | 115 // Gets the schema for the extension API with namespace |full_name|. |
116 // Ownership remains with this object. | 116 // Ownership remains with this object. |
117 const base::DictionaryValue* GetSchema(const std::string& full_name); | 117 const base::DictionaryValue* GetSchema(const std::string& full_name); |
118 | 118 |
119 // Splits a full name from the extension API into its API and child name | 119 // Splits a full name from the extension API into its API and child name |
120 // parts. Some examples: | 120 // parts. Some examples: |
121 // | 121 // |
122 // "bookmarks.create" -> ("bookmarks", "create") | 122 // "bookmarks.create" -> ("bookmarks", "create") |
123 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") | 123 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // FeatureProviders used for resolving dependencies. | 157 // FeatureProviders used for resolving dependencies. |
158 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 158 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
159 FeatureProviderMap dependency_providers_; | 159 FeatureProviderMap dependency_providers_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 161 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace extensions | 164 } // namespace extensions |
165 | 165 |
166 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 166 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
OLD | NEW |