Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 // Gets the schema for the extension API with namespace |full_name|. | 84 // Gets the schema for the extension API with namespace |full_name|. |
| 85 // Ownership remains with this object. | 85 // Ownership remains with this object. |
| 86 const base::DictionaryValue* GetSchema(const std::string& full_name); | 86 const base::DictionaryValue* GetSchema(const std::string& full_name); |
| 87 | 87 |
| 88 // Gets the APIs available to |context| given an |extension| and |url|. The | 88 // Gets the APIs available to |context| given an |extension| and |url|. The |
| 89 // extension or URL may not be relevant to all contexts, and may be left | 89 // extension or URL may not be relevant to all contexts, and may be left |
| 90 // NULL/empty. | 90 // NULL/empty. |
| 91 scoped_ptr<std::set<std::string> > GetAPIsForContext( | 91 scoped_ptr<std::set<std::string> > GetAPIsForContext( |
| 92 Feature::Context context, const Extension* extension, const GURL& url); | 92 Feature::Context context, const Extension* extension, const GURL& url); |
| 93 | 93 |
| 94 scoped_ptr<std::set<std::string> > GetAllAPINames(); | |
|
not at google - send to devlin
2012/12/13 22:26:40
just return a std::set<std::string>, the GetAPIsFo
cduvall
2012/12/14 00:25:18
Done.
| |
| 95 | |
| 94 // Gets a Feature object describing the API with the specified |full_name|. | 96 // Gets a Feature object describing the API with the specified |full_name|. |
| 95 // This can be either an API namespace (like history, or | 97 // This can be either an API namespace (like history, or |
| 96 // experimental.bookmarks), or it can be an individual function or event. | 98 // experimental.bookmarks), or it can be an individual function or event. |
| 97 virtual Feature* GetFeature(const std::string& full_name) OVERRIDE; | 99 virtual Feature* GetFeature(const std::string& full_name) OVERRIDE; |
| 98 | 100 |
| 99 // Splits a full name from the extension API into its API and child name | 101 // Splits a full name from the extension API into its API and child name |
| 100 // parts. Some examples: | 102 // parts. Some examples: |
| 101 // | 103 // |
| 102 // "bookmarks.create" -> ("bookmarks", "create") | 104 // "bookmarks.create" -> ("bookmarks", "create") |
| 103 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") | 105 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 // FeatureProviders used for resolving dependencies. | 182 // FeatureProviders used for resolving dependencies. |
| 181 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; | 183 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; |
| 182 FeatureProviderMap dependency_providers_; | 184 FeatureProviderMap dependency_providers_; |
| 183 | 185 |
| 184 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 186 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
| 185 }; | 187 }; |
| 186 | 188 |
| 187 } // extensions | 189 } // extensions |
| 188 | 190 |
| 189 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 191 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
| OLD | NEW |