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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 void InitDefaultConfiguration(); | 113 void InitDefaultConfiguration(); |
114 | 114 |
115 // Loads the schemas registered with RegisterSchema(). | 115 // Loads the schemas registered with RegisterSchema(). |
116 void LoadAllSchemas(); | 116 void LoadAllSchemas(); |
117 | 117 |
118 private: | 118 private: |
119 friend struct DefaultSingletonTraits<ExtensionAPI>; | 119 friend struct DefaultSingletonTraits<ExtensionAPI>; |
120 | 120 |
121 // Loads a schema. | 121 // Loads a schema. |
122 void LoadSchema(const base::StringPiece& schema); | 122 void LoadSchema(const std::string& name, const base::StringPiece& schema); |
123 | 123 |
124 // Returns true if the function or event under |namespace_node| with | 124 // Returns true if the function or event under |namespace_node| with |
125 // the specified |child_name| is privileged, or false otherwise. If the name | 125 // the specified |child_name| is privileged, or false otherwise. If the name |
126 // is not found, defaults to privileged. | 126 // is not found, defaults to privileged. |
127 bool IsChildNamePrivileged(const base::DictionaryValue* namespace_node, | 127 bool IsChildNamePrivileged(const base::DictionaryValue* namespace_node, |
128 const std::string& child_name); | 128 const std::string& child_name); |
129 | 129 |
130 // Adds all APIs to |out| that |extension| has any permission (required or | 130 // Adds all APIs to |out| that |extension| has any permission (required or |
131 // optional) to use. | 131 // optional) to use. |
132 // NOTE: This only works for non-feature-controlled APIs. | 132 // NOTE: This only works for non-feature-controlled APIs. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // FeatureProviders used for resolving dependencies. | 182 // FeatureProviders used for resolving dependencies. |
183 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; | 183 typedef std::map<std::string, FeatureProvider*> FeatureProviderMap; |
184 FeatureProviderMap dependency_providers_; | 184 FeatureProviderMap dependency_providers_; |
185 | 185 |
186 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 186 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
187 }; | 187 }; |
188 | 188 |
189 } // extensions | 189 } // extensions |
190 | 190 |
191 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 191 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
OLD | NEW |