Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: extensions/common/features/base_feature_provider.h

Issue 2133783002: [Extensions] Break up BaseFeatureProvider, create JSONFeatureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/common/features/base_feature_provider.h
diff --git a/extensions/common/features/base_feature_provider.h b/extensions/common/features/base_feature_provider.h
index 503371e05862518348487d5ece77d6be387e157e..8e55acbcb342a7c837599bafd065cd23c59b15a9 100644
--- a/extensions/common/features/base_feature_provider.h
+++ b/extensions/common/features/base_feature_provider.h
@@ -10,24 +10,14 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "extensions/common/features/feature_provider.h"
-#include "extensions/common/features/simple_feature.h"
-
-namespace Base {
-class DictionaryValue;
-}
namespace extensions {
+class Feature;
-// Reads Features out of a simple JSON file description.
class BaseFeatureProvider : public FeatureProvider {
asargent_no_longer_on_chrome 2016/07/11 22:39:20 nit: this could use a brief class overview comment
Devlin 2016/07/12 00:45:29 Done.
public:
- typedef SimpleFeature*(*FeatureFactory)();
-
- // Creates a new BaseFeatureProvider. Pass null to |factory| to have the
- // provider create plain old Feature instances.
- BaseFeatureProvider(const base::DictionaryValue& root,
- FeatureFactory factory);
~BaseFeatureProvider() override;
// Gets the feature |feature_name|, if it exists.
@@ -37,13 +27,12 @@ class BaseFeatureProvider : public FeatureProvider {
const FeatureMap& GetAllFeatures() const override;
- private:
+ protected:
+ BaseFeatureProvider();
std::map<std::string, std::unique_ptr<Feature>> features_;
- // Populated on first use.
- mutable std::vector<std::string> feature_names_;
-
- FeatureFactory factory_;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BaseFeatureProvider);
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698