| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Whitelist); | 199 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Whitelist); |
| 200 | 200 |
| 201 // Holds String to Enum value mappings. | 201 // Holds String to Enum value mappings. |
| 202 struct Mappings; | 202 struct Mappings; |
| 203 | 203 |
| 204 static bool IsIdInList(const std::string& extension_id, | 204 static bool IsIdInList(const std::string& extension_id, |
| 205 const std::vector<std::string>& list); | 205 const std::vector<std::string>& list); |
| 206 | 206 |
| 207 bool MatchesManifestLocation(Manifest::Location manifest_location) const; | 207 bool MatchesManifestLocation(Manifest::Location manifest_location) const; |
| 208 | 208 |
| 209 // Checks if the feature is allowed in a session of type |session_type| |
| 210 // (based on session type feature restrictions). |
| 211 bool MatchesSessionTypes(FeatureSessionType session_type) const; |
| 212 |
| 209 Availability CheckDependencies( | 213 Availability CheckDependencies( |
| 210 const base::Callback<Availability(const Feature*)>& checker) const; | 214 const base::Callback<Availability(const Feature*)>& checker) const; |
| 211 | 215 |
| 212 static bool IsValidExtensionId(const std::string& extension_id); | 216 static bool IsValidExtensionId(const std::string& extension_id); |
| 213 | 217 |
| 214 // For clarity and consistency, we handle the default value of each of these | 218 // For clarity and consistency, we handle the default value of each of these |
| 215 // members the same way: it matches everything. It is up to the higher level | 219 // members the same way: it matches everything. It is up to the higher level |
| 216 // code that reads Features out of static data to validate that data and set | 220 // code that reads Features out of static data to validate that data and set |
| 217 // sensible defaults. | 221 // sensible defaults. |
| 218 std::vector<std::string> blacklist_; | 222 std::vector<std::string> blacklist_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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_; |
| 233 | 237 |
| 234 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 238 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
| 235 }; | 239 }; |
| 236 | 240 |
| 237 } // namespace extensions | 241 } // namespace extensions |
| 238 | 242 |
| 239 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 243 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| OLD | NEW |