| 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_COMPLEX_FEATURE_H_ | 5 #ifndef EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ |
| 6 #define EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ | 6 #define EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // available, but not if only some combination of Features is available. | 22 // available, but not if only some combination of Features is available. |
| 23 class ComplexFeature : public Feature { | 23 class ComplexFeature : public Feature { |
| 24 public: | 24 public: |
| 25 using FeatureList = std::vector<std::unique_ptr<Feature>>; | 25 using FeatureList = std::vector<std::unique_ptr<Feature>>; |
| 26 | 26 |
| 27 explicit ComplexFeature(std::unique_ptr<FeatureList> features); | 27 explicit ComplexFeature(std::unique_ptr<FeatureList> features); |
| 28 ~ComplexFeature() override; | 28 ~ComplexFeature() override; |
| 29 | 29 |
| 30 // extensions::Feature: | 30 // extensions::Feature: |
| 31 Availability IsAvailableToManifest(const std::string& extension_id, | 31 Availability IsAvailableToManifest(const std::string& extension_id, |
| 32 const std::string& hashed_id, |
| 32 Manifest::Type type, | 33 Manifest::Type type, |
| 33 Manifest::Location location, | 34 Manifest::Location location, |
| 34 int manifest_version, | 35 int manifest_version, |
| 35 Platform platform) const override; | 36 Platform platform) const override; |
| 36 | 37 |
| 37 Availability IsAvailableToContext(const Extension* extension, | 38 Availability IsAvailableToContext(const Extension* extension, |
| 38 Context context, | 39 Context context, |
| 39 const GURL& url, | 40 const GURL& url, |
| 40 Platform platform) const override; | 41 Platform platform) const override; |
| 41 | 42 |
| 42 bool IsIdInBlacklist(const std::string& extension_id) const override; | 43 bool IsIdInBlacklist(const std::string& extension_id, |
| 43 bool IsIdInWhitelist(const std::string& extension_id) const override; | 44 const std::string& hashed_id) const override; |
| 45 bool IsIdInWhitelist(const std::string& extension_id, |
| 46 const std::string& hashed_id) const override; |
| 44 | 47 |
| 45 protected: | 48 protected: |
| 46 // extensions::Feature: | 49 // extensions::Feature: |
| 47 std::string GetAvailabilityMessage(AvailabilityResult result, | 50 std::string GetAvailabilityMessage(AvailabilityResult result, |
| 48 Manifest::Type type, | 51 Manifest::Type type, |
| 49 const GURL& url, | 52 const GURL& url, |
| 50 Context context) const override; | 53 Context context) const override; |
| 51 | 54 |
| 52 bool IsInternal() const override; | 55 bool IsInternal() const override; |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 FeatureList features_; | 58 FeatureList features_; |
| 56 | 59 |
| 57 DISALLOW_COPY_AND_ASSIGN(ComplexFeature); | 60 DISALLOW_COPY_AND_ASSIGN(ComplexFeature); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 } // namespace extensions | 63 } // namespace extensions |
| 61 | 64 |
| 62 #endif // EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ | 65 #endif // EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ |
| OLD | NEW |