Index: chrome/common/extensions/simple_feature_provider.h |
diff --git a/chrome/common/extensions/simple_feature_provider.h b/chrome/common/extensions/simple_feature_provider.h |
index 2ba5e5283bfcc7d34708551c299e51679f92f2b5..0b9172c0ec328c107ca43019ccf419047ad5b447 100644 |
--- a/chrome/common/extensions/simple_feature_provider.h |
+++ b/chrome/common/extensions/simple_feature_provider.h |
@@ -12,16 +12,20 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/values.h" |
#include "chrome/common/extensions/feature.h" |
+#include "chrome/common/extensions/feature_provider.h" |
namespace extensions { |
// Reads Features out of a simple JSON file description. |
-class SimpleFeatureProvider { |
+class SimpleFeatureProvider : public FeatureProvider { |
public: |
- // Create an instance for an arbitrary hunk of JSON. This is typically used |
- // during tests. |
- explicit SimpleFeatureProvider(scoped_ptr<DictionaryValue> root); |
- ~SimpleFeatureProvider(); |
+ typedef Feature*(*FeatureFactory)(); |
+ |
+ // Creates a new SimpleFeatureProvider. Pass null to |factory| to have the |
+ // provider create plain old Feature instances. |
+ SimpleFeatureProvider(scoped_ptr<DictionaryValue> root, |
+ FeatureFactory factory); |
+ virtual ~SimpleFeatureProvider(); |
// Gets an instance for the _manifest_features.json file that is baked into |
// Chrome as a resource. |
@@ -35,10 +39,12 @@ class SimpleFeatureProvider { |
std::set<std::string> GetAllFeatureNames() const; |
// Gets the feature |feature_name|, if it exists. |
- scoped_ptr<Feature> GetFeature(const std::string& feature_name) const; |
+ virtual scoped_ptr<Feature> GetFeature( |
+ const std::string& feature_name) OVERRIDE; |
private: |
scoped_ptr<DictionaryValue> root_; |
+ FeatureFactory factory_; |
}; |
} // namespace extensions |