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

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

Issue 2133783002: [Extensions] Break up BaseFeatureProvider, create JSONFeatureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master 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/json_feature_provider.h
diff --git a/extensions/common/features/json_feature_provider.h b/extensions/common/features/json_feature_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..37a571ad6c56398bd178cfebadb2b41409b8f817
--- /dev/null
+++ b/extensions/common/features/json_feature_provider.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_COMMON_FEATURES_JSON_FEATURE_PROVIDER_H_
+#define EXTENSIONS_COMMON_FEATURES_JSON_FEATURE_PROVIDER_H_
+
+#include "extensions/common/features/base_feature_provider.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace extensions {
+class SimpleFeature;
+
+// Reads Features out of a simple JSON file description.
+class JSONFeatureProvider : public BaseFeatureProvider {
+ public:
+ typedef SimpleFeature* (*FeatureFactory)();
+
+ // Creates a new JSONFeatureProvider. Pass null to |factory| to have the
+ // provider create plain old Feature instances.
+ JSONFeatureProvider(const base::DictionaryValue& root,
+ FeatureFactory factory);
+ ~JSONFeatureProvider() override;
+
+ private:
+ FeatureFactory factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(JSONFeatureProvider);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_FEATURES_JSON_FEATURE_PROVIDER_H_
« no previous file with comments | « extensions/common/features/base_feature_provider.cc ('k') | extensions/common/features/json_feature_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698