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. |
| 113 bool IsAvailableToWebUI(const std::string& name); |
| 114 |
112 // Gets the schema for the extension API with namespace |full_name|. | 115 // Gets the schema for the extension API with namespace |full_name|. |
113 // Ownership remains with this object. | 116 // Ownership remains with this object. |
114 const base::DictionaryValue* GetSchema(const std::string& full_name); | 117 const base::DictionaryValue* GetSchema(const std::string& full_name); |
115 | 118 |
116 // 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 |
117 // parts. Some examples: | 120 // parts. Some examples: |
118 // | 121 // |
119 // "bookmarks.create" -> ("bookmarks", "create") | 122 // "bookmarks.create" -> ("bookmarks", "create") |
120 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") | 123 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") |
121 // "storage.sync.set" -> ("storage", "sync.get") | 124 // "storage.sync.set" -> ("storage", "sync.get") |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // FeatureProviders used for resolving dependencies. | 157 // FeatureProviders used for resolving dependencies. |
155 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 158 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
156 FeatureProviderMap dependency_providers_; | 159 FeatureProviderMap dependency_providers_; |
157 | 160 |
158 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 161 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
159 }; | 162 }; |
160 | 163 |
161 } // namespace extensions | 164 } // namespace extensions |
162 | 165 |
163 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 166 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
OLD | NEW |