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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 std::string GetAPINameFromFullName(const std::string& full_name, | 123 std::string GetAPINameFromFullName(const std::string& full_name, |
124 std::string* child_name); | 124 std::string* child_name); |
125 | 125 |
126 // Gets a feature from any dependency provider registered with ExtensionAPI. | 126 // Gets a feature from any dependency provider registered with ExtensionAPI. |
127 // Returns NULL if the feature could not be found. | 127 // Returns NULL if the feature could not be found. |
128 Feature* GetFeatureDependency(const std::string& dependency_name); | 128 Feature* GetFeatureDependency(const std::string& dependency_name); |
129 | 129 |
130 private: | 130 private: |
131 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); | 131 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); |
132 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace); | 132 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace); |
133 friend struct DefaultSingletonTraits<ExtensionAPI>; | 133 friend struct base::DefaultSingletonTraits<ExtensionAPI>; |
134 | 134 |
135 void InitDefaultConfiguration(); | 135 void InitDefaultConfiguration(); |
136 | 136 |
137 bool default_configuration_initialized_; | 137 bool default_configuration_initialized_; |
138 | 138 |
139 // Loads a schema. | 139 // Loads a schema. |
140 void LoadSchema(const std::string& name, const base::StringPiece& schema); | 140 void LoadSchema(const std::string& name, const base::StringPiece& schema); |
141 | 141 |
142 // Map from each API that hasn't been loaded yet to the schema which defines | 142 // Map from each API that hasn't been loaded yet to the schema which defines |
143 // it. Note that there may be multiple APIs per schema. | 143 // it. Note that there may be multiple APIs per schema. |
144 typedef std::map<std::string, int> UnloadedSchemaMap; | 144 typedef std::map<std::string, int> UnloadedSchemaMap; |
145 UnloadedSchemaMap unloaded_schemas_; | 145 UnloadedSchemaMap unloaded_schemas_; |
146 | 146 |
147 // Schemas for each namespace. | 147 // Schemas for each namespace. |
148 typedef std::map<std::string, linked_ptr<const base::DictionaryValue> > | 148 typedef std::map<std::string, linked_ptr<const base::DictionaryValue> > |
149 SchemaMap; | 149 SchemaMap; |
150 SchemaMap schemas_; | 150 SchemaMap schemas_; |
151 | 151 |
152 // FeatureProviders used for resolving dependencies. | 152 // FeatureProviders used for resolving dependencies. |
153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
154 FeatureProviderMap dependency_providers_; | 154 FeatureProviderMap dependency_providers_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
157 }; | 157 }; |
158 | 158 |
159 } // namespace extensions | 159 } // namespace extensions |
160 | 160 |
161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
OLD | NEW |