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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 private: | 74 private: |
75 friend struct DefaultSingletonTraits<ExtensionAPI>; | 75 friend struct DefaultSingletonTraits<ExtensionAPI>; |
76 | 76 |
77 ExtensionAPI(); | 77 ExtensionAPI(); |
78 ~ExtensionAPI(); | 78 ~ExtensionAPI(); |
79 | 79 |
80 // Loads a schema from a resource. | 80 // Loads a schema from a resource. |
81 void LoadSchemaFromResource(int resource_id); | 81 void LoadSchemaFromResource(int resource_id); |
82 | 82 |
| 83 // Given a schema in ListValue form, registers it in a map. Takes ownership |
| 84 // of |loaded_schema|. |
| 85 void RegisterSchema(base::ListValue* loaded_schema); |
| 86 |
83 // Find an item in |list| with the specified property name and value, or NULL | 87 // Find an item in |list| with the specified property name and value, or NULL |
84 // if no such item exists. | 88 // if no such item exists. |
85 base::DictionaryValue* FindListItem(const base::ListValue* list, | 89 base::DictionaryValue* FindListItem(const base::ListValue* list, |
86 const std::string& property_name, | 90 const std::string& property_name, |
87 const std::string& property_value) const; | 91 const std::string& property_value) const; |
88 | 92 |
89 // Returns true if the function or event under |namespace_node| with | 93 // Returns true if the function or event under |namespace_node| with |
90 // the specified |child_name| is privileged, or false otherwise. If the name | 94 // the specified |child_name| is privileged, or false otherwise. If the name |
91 // is not found, defaults to privileged. | 95 // is not found, defaults to privileged. |
92 bool IsChildNamePrivileged(const base::DictionaryValue* namespace_node, | 96 bool IsChildNamePrivileged(const base::DictionaryValue* namespace_node, |
(...skipping 19 matching lines...) Expand all Loading... |
112 | 116 |
113 // APIs that are not entirely unprivileged, but have unprivileged components. | 117 // APIs that are not entirely unprivileged, but have unprivileged components. |
114 std::set<std::string> partially_unprivileged_apis_; | 118 std::set<std::string> partially_unprivileged_apis_; |
115 | 119 |
116 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 120 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
117 }; | 121 }; |
118 | 122 |
119 } // extensions | 123 } // extensions |
120 | 124 |
121 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 125 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
OLD | NEW |