| 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 14 matching lines...) Expand all Loading... |
| 25 class ListValue; | 25 class ListValue; |
| 26 class Value; | 26 class Value; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class GURL; | 29 class GURL; |
| 30 class Extension; | 30 class Extension; |
| 31 class ExtensionPermissionSet; | 31 class ExtensionPermissionSet; |
| 32 | 32 |
| 33 namespace extensions { | 33 namespace extensions { |
| 34 | 34 |
| 35 class ExtensionAPIFeature; |
| 35 class Feature; | 36 class Feature; |
| 36 | 37 |
| 37 // C++ Wrapper for the JSON API definitions in chrome/common/extensions/api/. | 38 // C++ Wrapper for the JSON API definitions in chrome/common/extensions/api/. |
| 38 // | 39 // |
| 39 // WARNING: This class is accessed on multiple threads in the browser process | 40 // WARNING: This class is accessed on multiple threads in the browser process |
| 40 // (see ExtensionFunctionDispatcher). No state should be modified after | 41 // (see ExtensionFunctionDispatcher). No state should be modified after |
| 41 // construction. | 42 // construction. |
| 42 class ExtensionAPI : public FeatureProvider { | 43 class ExtensionAPI : public FeatureProvider { |
| 43 public: | 44 public: |
| 44 // Returns a single shared instance of this class. This is the typical use | 45 // Returns a single shared instance of this class. This is the typical use |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 169 |
| 169 // APIs that are entirely unprivileged. | 170 // APIs that are entirely unprivileged. |
| 170 std::set<std::string> completely_unprivileged_apis_; | 171 std::set<std::string> completely_unprivileged_apis_; |
| 171 | 172 |
| 172 // APIs that are not entirely unprivileged, but have unprivileged components. | 173 // APIs that are not entirely unprivileged, but have unprivileged components. |
| 173 std::set<std::string> partially_unprivileged_apis_; | 174 std::set<std::string> partially_unprivileged_apis_; |
| 174 | 175 |
| 175 // APIs that have URL matching permissions. | 176 // APIs that have URL matching permissions. |
| 176 std::map<std::string, URLPatternSet> url_matching_apis_; | 177 std::map<std::string, URLPatternSet> url_matching_apis_; |
| 177 | 178 |
| 178 typedef std::map<std::string, linked_ptr<Feature> > FeatureMap; | 179 typedef std::map<std::string, linked_ptr<ExtensionAPIFeature> > FeatureMap; |
| 179 typedef std::map<std::string, linked_ptr<FeatureMap> > APIFeatureMap; | 180 FeatureMap features_; |
| 180 APIFeatureMap features_; | |
| 181 | 181 |
| 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 |