| 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 #include "extensions/common/features/base_feature_provider.h" | 5 #include "extensions/common/features/base_feature_provider.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 LOG(ERROR) << iter.key() << ": Feature rules must be dictionaries."; | 121 LOG(ERROR) << iter.key() << ": Feature rules must be dictionaries."; |
| 122 continue; | 122 continue; |
| 123 } | 123 } |
| 124 | 124 |
| 125 scoped_ptr<SimpleFeature> feature((*factory_)()); | 125 scoped_ptr<SimpleFeature> feature((*factory_)()); |
| 126 if (!ParseFeature(static_cast<const base::DictionaryValue*>(*list_iter), | 126 if (!ParseFeature(static_cast<const base::DictionaryValue*>(*list_iter), |
| 127 iter.key(), | 127 iter.key(), |
| 128 feature.get())) | 128 feature.get())) |
| 129 continue; | 129 continue; |
| 130 | 130 |
| 131 features->push_back(feature.release()); | 131 features->push_back(feature.Pass()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass())); | 134 linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass())); |
| 135 feature->set_name(iter.key()); | 135 feature->set_name(iter.key()); |
| 136 | 136 |
| 137 features_[iter.key()] = feature; | 137 features_[iter.key()] = feature; |
| 138 } else { | 138 } else { |
| 139 LOG(ERROR) << iter.key() << ": Feature description must be dictionary or" | 139 LOG(ERROR) << iter.key() << ": Feature description must be dictionary or" |
| 140 << " list of dictionaries."; | 140 << " list of dictionaries."; |
| 141 } | 141 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 std::vector<Feature*> result; | 194 std::vector<Feature*> result; |
| 195 result.reserve(std::distance(first_child, after_children)); | 195 result.reserve(std::distance(first_child, after_children)); |
| 196 for (FeatureMap::const_iterator it = first_child; it != after_children; | 196 for (FeatureMap::const_iterator it = first_child; it != after_children; |
| 197 ++it) { | 197 ++it) { |
| 198 result.push_back(it->second.get()); | 198 result.push_back(it->second.get()); |
| 199 } | 199 } |
| 200 return result; | 200 return result; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace extensions | 203 } // namespace extensions |
| OLD | NEW |