| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 Feature::Context context, | 97 Feature::Context context, |
| 98 const GURL& url); | 98 const GURL& url); |
| 99 | 99 |
| 100 // Determines whether an API, or any parts of that API, are available in | 100 // Determines whether an API, or any parts of that API, are available in |
| 101 // |context|. | 101 // |context|. |
| 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 | |
| 108 // extension context, such as content scripts, iframes, or web pages. | |
| 109 bool IsAvailableInUntrustedContext(const std::string& name, | |
| 110 const Extension* extension); | |
| 111 | |
| 112 // Returns true if |name| is available to WebUI contexts on |url|. | 107 // Returns true if |name| is available to WebUI contexts on |url|. |
| 113 bool IsAvailableToWebUI(const std::string& name, const GURL& url); | 108 bool IsAvailableToWebUI(const std::string& name, const GURL& url); |
| 114 | 109 |
| 115 // Gets the schema for the extension API with namespace |full_name|. | 110 // Gets the schema for the extension API with namespace |full_name|. |
| 116 // Ownership remains with this object. | 111 // Ownership remains with this object. |
| 117 const base::DictionaryValue* GetSchema(const std::string& full_name); | 112 const base::DictionaryValue* GetSchema(const std::string& full_name); |
| 118 | 113 |
| 119 // Splits a full name from the extension API into its API and child name | 114 // Splits a full name from the extension API into its API and child name |
| 120 // parts. Some examples: | 115 // parts. Some examples: |
| 121 // | 116 // |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // FeatureProviders used for resolving dependencies. | 152 // FeatureProviders used for resolving dependencies. |
| 158 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
| 159 FeatureProviderMap dependency_providers_; | 154 FeatureProviderMap dependency_providers_; |
| 160 | 155 |
| 161 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
| 162 }; | 157 }; |
| 163 | 158 |
| 164 } // namespace extensions | 159 } // namespace extensions |
| 165 | 160 |
| 166 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
| OLD | NEW |