Chromium Code Reviews| 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_FEATURES_FEATURE_PROVIDER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_PROVIDER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_PROVIDER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 | 11 |
| 12 class Feature; | 12 class Feature; |
| 13 | 13 |
| 14 // Implemented by classes that can vend features. | 14 // Implemented by classes that can vend features. |
| 15 class FeatureProvider { | 15 class FeatureProvider { |
| 16 public: | 16 public: |
| 17 FeatureProvider() {} | 17 FeatureProvider() {} |
| 18 virtual ~FeatureProvider() {} | 18 virtual ~FeatureProvider() {} |
| 19 | 19 |
| 20 // Returns the feature with the specified name. | 20 // Returns the feature with the specified name. |
| 21 virtual Feature* GetFeature(const std::string& name) = 0; | 21 virtual Feature* GetFeature(const std::string& name) = 0; |
| 22 | 22 |
| 23 // Returns all features described by this instance. | 23 // Returns all features described by this instance. |
| 24 virtual std::set<std::string> GetAllFeatureNames() = 0; | 24 virtual std::vector<std::string> GetAllFeatureNames() = 0; |
| 25 | |
| 26 // Returns all features described by this instance that do not have a parent. | |
| 27 virtual std::vector<std::string> GetAllTopLevelFeatureNames() = 0; | |
|
not at google - send to devlin
2013/05/23 00:09:40
would probably be simpler if we let callers filter
cduvall
2013/05/24 03:13:49
Done.
| |
| 25 }; | 28 }; |
| 26 | 29 |
| 27 } // namespace extensions | 30 } // namespace extensions |
| 28 | 31 |
| 29 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_PROVIDER_H_ | 32 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_PROVIDER_H_ |
| OLD | NEW |