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

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

Issue 2150193002: [Extensions] Add a SimpleFeature::Validate function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests 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/simple_feature.h
diff --git a/extensions/common/features/simple_feature.h b/extensions/common/features/simple_feature.h
index 373f6e54743da0beb7cacaa8d9be97f9b34272c5..c9508d80036ece5882c3584e578acac27f22dfed 100644
--- a/extensions/common/features/simple_feature.h
+++ b/extensions/common/features/simple_feature.h
@@ -50,7 +50,9 @@ class SimpleFeature : public Feature {
// Unspecified values in the JSON are not modified in the object. This allows
// us to implement inheritance by parsing one value after another. Returns
lazyboy 2016/07/15 22:53:40 This comment needs to be updated. Also add a comm
Devlin 2016/07/18 17:51:58 Done.
// the error found, or an empty string on success.
- virtual std::string Parse(const base::DictionaryValue* dictionary);
+ void Parse(const base::DictionaryValue* dictionary);
+
+ virtual bool Validate(std::string* error);
Availability IsAvailableToContext(const Extension* extension,
Context context) const {
@@ -153,7 +155,9 @@ class SimpleFeature : public Feature {
FRIEND_TEST_ALL_PREFIXES(ManifestUnitTest, Extension);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Blacklist);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, CommandLineSwitch);
+ FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, ComplexFeatureAvailability);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Context);
+ FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, FeatureValidation);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, HashedIdBlacklist);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, HashedIdWhitelist);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Inheritance);
@@ -168,6 +172,7 @@ class SimpleFeature : public Feature {
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, ParsePlatforms);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, ParseWhitelist);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Platform);
+ FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, SimpleFeatureAvailability);
FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Whitelist);
// Holds String to Enum value mappings.
@@ -200,6 +205,7 @@ class SimpleFeature : public Feature {
bool component_extensions_auto_granted_;
std::string command_line_switch_;
std::unique_ptr<version_info::Channel> channel_;
+ bool internal_;
DISALLOW_COPY_AND_ASSIGN(SimpleFeature);
};

Powered by Google App Engine
This is Rietveld 408576698