OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/common/extensions/feature.h" |
| 10 |
| 11 #include <map> |
| 12 #include <set> |
| 13 #include "base/memory/linked_ptr.h" |
| 14 |
| 15 namespace extensions { |
| 16 |
| 17 class ExtensionAPIFeature : public Feature { |
| 18 public: |
| 19 ExtensionAPIFeature(); |
| 20 virtual ~ExtensionAPIFeature(); |
| 21 |
| 22 std::set<std::string>* dependencies(); |
| 23 |
| 24 virtual void Parse(const DictionaryValue* value) OVERRIDE; |
| 25 |
| 26 // Returns a child feature with the given name. |
| 27 // TODO(aa): This will return NULL if the child is empty. It would be better |
| 28 // to generate a feature on the fly for such children, but that will require |
| 29 // reworking ownership a bit since callers currently do not expect to ever |
| 30 // take ownership of the values returned here. |
| 31 Feature* GetChild(const std::string& name) const; |
| 32 |
| 33 private: |
| 34 std::set<std::string> dependencies_; |
| 35 |
| 36 typedef std::map<std::string, |
| 37 linked_ptr<ExtensionAPIFeature> > ChildFeatureMap; |
| 38 ChildFeatureMap child_features_; |
| 39 }; |
| 40 |
| 41 } // namespace extensions |
| 42 |
| 43 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_ |
OLD | NEW |