| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/callback_forward.h" | 16 #include "base/callback_forward.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "components/version_info/version_info.h" | 21 #include "components/version_info/version_info.h" |
| 22 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
| 23 #include "extensions/common/features/feature.h" | 23 #include "extensions/common/features/feature.h" |
| 24 #include "extensions/common/features/feature_session_type.h" | 24 #include "extensions/common/features/feature_session_type.h" |
| 25 #include "extensions/common/manifest.h" | 25 #include "extensions/common/manifest.h" |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| 28 | 28 |
| 29 class BaseFeatureProviderTest; | 29 class FeatureProviderTest; |
| 30 class ExtensionAPITest; | 30 class ExtensionAPITest; |
| 31 class ManifestUnitTest; | 31 class ManifestUnitTest; |
| 32 class SimpleFeatureTest; | 32 class SimpleFeatureTest; |
| 33 | 33 |
| 34 class SimpleFeature : public Feature { | 34 class SimpleFeature : public Feature { |
| 35 public: | 35 public: |
| 36 // Used by tests to override the cached --whitelisted-extension-id. | 36 // Used by tests to override the cached --whitelisted-extension-id. |
| 37 class ScopedWhitelistForTest { | 37 class ScopedWhitelistForTest { |
| 38 public: | 38 public: |
| 39 explicit ScopedWhitelistForTest(const std::string& id); | 39 explicit ScopedWhitelistForTest(const std::string& id); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 Availability CreateAvailability(AvailabilityResult result, | 163 Availability CreateAvailability(AvailabilityResult result, |
| 164 Context context) const; | 164 Context context) const; |
| 165 Availability CreateAvailability(AvailabilityResult result, | 165 Availability CreateAvailability(AvailabilityResult result, |
| 166 version_info::Channel channel) const; | 166 version_info::Channel channel) const; |
| 167 Availability CreateAvailability(AvailabilityResult result, | 167 Availability CreateAvailability(AvailabilityResult result, |
| 168 FeatureSessionType session_type) const; | 168 FeatureSessionType session_type) const; |
| 169 | 169 |
| 170 private: | 170 private: |
| 171 friend struct FeatureComparator; | 171 friend struct FeatureComparator; |
| 172 friend class SimpleFeatureTest; | 172 friend class SimpleFeatureTest; |
| 173 FRIEND_TEST_ALL_PREFIXES(BaseFeatureProviderTest, ManifestFeatureTypes); | 173 FRIEND_TEST_ALL_PREFIXES(FeatureProviderTest, ManifestFeatureTypes); |
| 174 FRIEND_TEST_ALL_PREFIXES(BaseFeatureProviderTest, PermissionFeatureTypes); | 174 FRIEND_TEST_ALL_PREFIXES(FeatureProviderTest, PermissionFeatureTypes); |
| 175 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); | 175 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); |
| 176 FRIEND_TEST_ALL_PREFIXES(FeaturesGenerationTest, FeaturesTest); | 176 FRIEND_TEST_ALL_PREFIXES(FeaturesGenerationTest, FeaturesTest); |
| 177 FRIEND_TEST_ALL_PREFIXES(ManifestUnitTest, Extension); | 177 FRIEND_TEST_ALL_PREFIXES(ManifestUnitTest, Extension); |
| 178 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Blacklist); | 178 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Blacklist); |
| 179 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, CommandLineSwitch); | 179 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, CommandLineSwitch); |
| 180 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, ComplexFeatureAvailability); | 180 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, ComplexFeatureAvailability); |
| 181 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Context); | 181 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, Context); |
| 182 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, SessionType); | 182 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, SessionType); |
| 183 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, FeatureValidation); | 183 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, FeatureValidation); |
| 184 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, HashedIdBlacklist); | 184 FRIEND_TEST_ALL_PREFIXES(SimpleFeatureTest, HashedIdBlacklist); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 bool is_internal_; | 234 bool is_internal_; |
| 235 std::string command_line_switch_; | 235 std::string command_line_switch_; |
| 236 std::unique_ptr<version_info::Channel> channel_; | 236 std::unique_ptr<version_info::Channel> channel_; |
| 237 | 237 |
| 238 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 238 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 } // namespace extensions | 241 } // namespace extensions |
| 242 | 242 |
| 243 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 243 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| OLD | NEW |