| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Determines whether an API, or any parts of that API, are available in | 99 // Determines whether an API, or any parts of that API, are available in |
| 100 // |context|. | 100 // |context|. |
| 101 bool IsAnyFeatureAvailableToContext(const Feature& api, | 101 bool IsAnyFeatureAvailableToContext(const Feature& api, |
| 102 const Extension* extension, | 102 const Extension* extension, |
| 103 Feature::Context context, | 103 Feature::Context context, |
| 104 const GURL& url); | 104 const GURL& url); |
| 105 | 105 |
| 106 // Returns true if |name| is available to WebUI contexts on |url|. | 106 // Returns true if |name| is available to WebUI contexts on |url|. |
| 107 bool IsAvailableToWebUI(const std::string& name, const GURL& url); | 107 bool IsAvailableToWebUI(const std::string& name, const GURL& url); |
| 108 | 108 |
| 109 // Gets the schema for the extension API with namespace |full_name|, or | 109 // Gets the schema for the extension API with namespace |full_name|. |
| 110 // nullptr if the schema could not be loaded. | |
| 111 // Ownership remains with this object. | 110 // Ownership remains with this object. |
| 112 const base::DictionaryValue* GetSchema(const std::string& full_name); | 111 const base::DictionaryValue* GetSchema(const std::string& full_name); |
| 113 | 112 |
| 114 // Splits a full name from the extension API into its API and child name | 113 // Splits a full name from the extension API into its API and child name |
| 115 // parts. Some examples: | 114 // parts. Some examples: |
| 116 // | 115 // |
| 117 // "bookmarks.create" -> ("bookmarks", "create") | 116 // "bookmarks.create" -> ("bookmarks", "create") |
| 118 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") | 117 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") |
| 119 // "storage.sync.set" -> ("storage", "sync.get") | 118 // "storage.sync.set" -> ("storage", "sync.get") |
| 120 // "<unknown-api>.monkey" -> ("", "") | 119 // "<unknown-api>.monkey" -> ("", "") |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // FeatureProviders used for resolving dependencies. | 151 // FeatureProviders used for resolving dependencies. |
| 153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 152 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
| 154 FeatureProviderMap dependency_providers_; | 153 FeatureProviderMap dependency_providers_; |
| 155 | 154 |
| 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 155 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 } // namespace extensions | 158 } // namespace extensions |
| 160 | 159 |
| 161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 160 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
| OLD | NEW |