OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FEATURES_BASE_FEATURE_PROVIDER_H_ | 5 #ifndef EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ |
6 #define EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ | 6 #define EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 typedef SimpleFeature*(*FeatureFactory)(); | 22 typedef SimpleFeature*(*FeatureFactory)(); |
23 | 23 |
24 // Creates a new BaseFeatureProvider. Pass null to |factory| to have the | 24 // Creates a new BaseFeatureProvider. Pass null to |factory| to have the |
25 // provider create plain old Feature instances. | 25 // provider create plain old Feature instances. |
26 BaseFeatureProvider(const base::DictionaryValue& root, | 26 BaseFeatureProvider(const base::DictionaryValue& root, |
27 FeatureFactory factory); | 27 FeatureFactory factory); |
28 virtual ~BaseFeatureProvider(); | 28 virtual ~BaseFeatureProvider(); |
29 | 29 |
30 // Gets the feature |feature_name|, if it exists. | 30 // Gets the feature |feature_name|, if it exists. |
31 virtual Feature* GetFeature(const std::string& feature_name) const OVERRIDE; | 31 virtual Feature* GetFeature(const std::string& feature_name) const override; |
32 virtual Feature* GetParent(Feature* feature) const OVERRIDE; | 32 virtual Feature* GetParent(Feature* feature) const override; |
33 virtual std::vector<Feature*> GetChildren(const Feature& parent) const | 33 virtual std::vector<Feature*> GetChildren(const Feature& parent) const |
34 OVERRIDE; | 34 override; |
35 | 35 |
36 virtual const std::vector<std::string>& GetAllFeatureNames() const OVERRIDE; | 36 virtual const std::vector<std::string>& GetAllFeatureNames() const override; |
37 | 37 |
38 private: | 38 private: |
39 typedef std::map<std::string, linked_ptr<Feature> > FeatureMap; | 39 typedef std::map<std::string, linked_ptr<Feature> > FeatureMap; |
40 FeatureMap features_; | 40 FeatureMap features_; |
41 | 41 |
42 // Populated on first use. | 42 // Populated on first use. |
43 mutable std::vector<std::string> feature_names_; | 43 mutable std::vector<std::string> feature_names_; |
44 | 44 |
45 FeatureFactory factory_; | 45 FeatureFactory factory_; |
46 }; | 46 }; |
47 | 47 |
48 } // namespace extensions | 48 } // namespace extensions |
49 | 49 |
50 #endif // EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ | 50 #endif // EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ |
OLD | NEW |