| 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 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 5 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| 6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <initializer_list> | 10 #include <initializer_list> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 Manifest::Location location, | 69 Manifest::Location location, |
| 70 int manifest_version, | 70 int manifest_version, |
| 71 Platform platform) const override; | 71 Platform platform) const override; |
| 72 Availability IsAvailableToContext(const Extension* extension, | 72 Availability IsAvailableToContext(const Extension* extension, |
| 73 Context context, | 73 Context context, |
| 74 const GURL& url, | 74 const GURL& url, |
| 75 Platform platform) const override; | 75 Platform platform) const override; |
| 76 bool IsInternal() const override; | 76 bool IsInternal() const override; |
| 77 bool IsIdInBlacklist(const std::string& extension_id) const override; | 77 bool IsIdInBlacklist(const std::string& extension_id) const override; |
| 78 bool IsIdInWhitelist(const std::string& extension_id) const override; | 78 bool IsIdInWhitelist(const std::string& extension_id) const override; |
| 79 std::string GetAlias() const override; |
| 80 std::string GetSource() const override; |
| 79 | 81 |
| 80 static bool IsIdInArray(const std::string& extension_id, | 82 static bool IsIdInArray(const std::string& extension_id, |
| 81 const char* const array[], | 83 const char* const array[], |
| 82 size_t array_length); | 84 size_t array_length); |
| 83 | 85 |
| 84 // Similar to Manifest::Location, these are the classes of locations | 86 // Similar to Manifest::Location, these are the classes of locations |
| 85 // supported in feature files. These should only be used in this class and in | 87 // supported in feature files. These should only be used in this class and in |
| 86 // generated files. | 88 // generated files. |
| 87 enum Location { | 89 enum Location { |
| 88 UNSPECIFIED_LOCATION, | 90 UNSPECIFIED_LOCATION, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 116 void set_matches(std::initializer_list<const char* const> matches); | 118 void set_matches(std::initializer_list<const char* const> matches); |
| 117 void set_max_manifest_version(int max_manifest_version) { | 119 void set_max_manifest_version(int max_manifest_version) { |
| 118 max_manifest_version_ = max_manifest_version; | 120 max_manifest_version_ = max_manifest_version; |
| 119 } | 121 } |
| 120 void set_min_manifest_version(int min_manifest_version) { | 122 void set_min_manifest_version(int min_manifest_version) { |
| 121 min_manifest_version_ = min_manifest_version; | 123 min_manifest_version_ = min_manifest_version; |
| 122 } | 124 } |
| 123 void set_noparent(bool no_parent) { no_parent_ = no_parent; } | 125 void set_noparent(bool no_parent) { no_parent_ = no_parent; } |
| 124 void set_platforms(std::initializer_list<Platform> platforms); | 126 void set_platforms(std::initializer_list<Platform> platforms); |
| 125 void set_whitelist(std::initializer_list<const char* const> whitelist); | 127 void set_whitelist(std::initializer_list<const char* const> whitelist); |
| 128 void set_alias(base::StringPiece alias); |
| 129 void set_source(base::StringPiece source); |
| 126 | 130 |
| 127 protected: | 131 protected: |
| 128 // Accessors used by subclasses in feature verification. | 132 // Accessors used by subclasses in feature verification. |
| 129 const std::vector<std::string>& blacklist() const { return blacklist_; } | 133 const std::vector<std::string>& blacklist() const { return blacklist_; } |
| 130 const std::vector<std::string>& whitelist() const { return whitelist_; } | 134 const std::vector<std::string>& whitelist() const { return whitelist_; } |
| 131 const std::vector<Manifest::Type>& extension_types() const { | 135 const std::vector<Manifest::Type>& extension_types() const { |
| 132 return extension_types_; | 136 return extension_types_; |
| 133 } | 137 } |
| 134 const std::vector<Platform>& platforms() const { return platforms_; } | 138 const std::vector<Platform>& platforms() const { return platforms_; } |
| 135 const std::vector<Context>& contexts() const { return contexts_; } | 139 const std::vector<Context>& contexts() const { return contexts_; } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 std::vector<Context> contexts_; | 227 std::vector<Context> contexts_; |
| 224 std::vector<Platform> platforms_; | 228 std::vector<Platform> platforms_; |
| 225 URLPatternSet matches_; | 229 URLPatternSet matches_; |
| 226 Location location_; | 230 Location location_; |
| 227 int min_manifest_version_; | 231 int min_manifest_version_; |
| 228 int max_manifest_version_; | 232 int max_manifest_version_; |
| 229 bool component_extensions_auto_granted_; | 233 bool component_extensions_auto_granted_; |
| 230 bool is_internal_; | 234 bool is_internal_; |
| 231 std::string command_line_switch_; | 235 std::string command_line_switch_; |
| 232 std::unique_ptr<version_info::Channel> channel_; | 236 std::unique_ptr<version_info::Channel> channel_; |
| 237 std::string alias_; |
| 238 std::string source_; |
| 233 | 239 |
| 234 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 240 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
| 235 }; | 241 }; |
| 236 | 242 |
| 237 } // namespace extensions | 243 } // namespace extensions |
| 238 | 244 |
| 239 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 245 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| OLD | NEW |