Chromium Code Reviews| Index: chrome/common/extensions/features/simple_feature_provider.cc |
| diff --git a/chrome/common/extensions/features/simple_feature_provider.cc b/chrome/common/extensions/features/simple_feature_provider.cc |
| index 4edcfe11c19544ae346e296bf3014334dd142e34..92ff894c83b7b79c1855e0a449382de8a08902da 100644 |
| --- a/chrome/common/extensions/features/simple_feature_provider.cc |
| +++ b/chrome/common/extensions/features/simple_feature_provider.cc |
| @@ -16,7 +16,7 @@ namespace extensions { |
| namespace { |
| template<class FeatureClass> |
| -Feature* CreateFeature() { |
| +SimpleFeature* CreateFeature() { |
| return new FeatureClass(); |
| } |
| @@ -65,19 +65,22 @@ base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER; |
| SimpleFeatureProvider::SimpleFeatureProvider(DictionaryValue* root, |
| FeatureFactory factory) |
| : factory_(factory ? factory : |
| - static_cast<FeatureFactory>(&CreateFeature<Feature>)) { |
| + static_cast<FeatureFactory>(&CreateFeature<SimpleFeature>)) { |
| for (DictionaryValue::Iterator iter(*root); iter.HasNext(); iter.Advance()) { |
| if (iter.value().GetType() != Value::TYPE_DICTIONARY) { |
| - LOG(ERROR) << iter.key() << ": Feature description must be dictionary."; |
| + if (iter.value().GetType() != Value::TYPE_LIST) |
| + LOG(ERROR) << iter.key() << ": Feature description must be dictionary."; |
| + else |
| + DVLOG(2) << iter.key() << ": Feature is a complex feature."; |
|
not at google - send to devlin
2012/12/12 17:42:41
I would hope this, by design, can never happen and
justinlin
2012/12/14 12:26:26
Updated.
|
| continue; |
| } |
| - linked_ptr<Feature> feature((*factory_)()); |
| + linked_ptr<SimpleFeature> feature((*factory_)()); |
| feature->set_name(iter.key()); |
| feature->Parse(static_cast<const DictionaryValue*>(&iter.value())); |
| if (feature->extension_types()->empty()) { |
| - LOG(ERROR) << iter.key() << ": Simple features must specify atleast one " |
| + LOG(ERROR) << iter.key() << ": Simple features must specify at least one " |
| << "value for extension_types."; |
| continue; |
| } |
| @@ -113,7 +116,7 @@ std::set<std::string> SimpleFeatureProvider::GetAllFeatureNames() const { |
| return result; |
| } |
| -Feature* SimpleFeatureProvider::GetFeature(const std::string& name) { |
| +SimpleFeature* SimpleFeatureProvider::GetFeature(const std::string& name) { |
| FeatureMap::iterator iter = features_.find(name); |
| if (iter != features_.end()) |
| return iter->second.get(); |