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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
12 #include "extensions/common/features/feature.h" | 12 #include "extensions/common/features/feature.h" |
13 #include "extensions/common/manifest.h" | 13 #include "extensions/common/manifest.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 // A ComplexFeature is composed of one or many Features. A ComplexFeature | 17 // A ComplexFeature is composed of one or many Features. A ComplexFeature |
18 // is available if any Feature (i.e. permission rule) that composes it is | 18 // is available if any Feature (i.e. permission rule) that composes it is |
19 // available, but not if only some combination of Features is available. | 19 // available, but not if only some combination of Features is available. |
20 class ComplexFeature : public Feature { | 20 class ComplexFeature : public Feature { |
21 public: | 21 public: |
22 typedef ScopedVector<Feature> FeatureList; | 22 typedef ScopedVector<Feature> FeatureList; |
23 | 23 |
24 explicit ComplexFeature(scoped_ptr<FeatureList> features); | 24 explicit ComplexFeature(scoped_ptr<FeatureList> features); |
25 virtual ~ComplexFeature(); | 25 virtual ~ComplexFeature(); |
26 | 26 |
27 // extensions::Feature: | 27 // extensions::Feature: |
28 virtual Availability IsAvailableToManifest(const std::string& extension_id, | 28 virtual Availability IsAvailableToManifest(const std::string& extension_id, |
29 Manifest::Type type, | 29 Manifest::Type type, |
30 Location location, | 30 Manifest::Location location, |
31 int manifest_version, | 31 int manifest_version, |
32 Platform platform) const OVERRIDE; | 32 Platform platform) const OVERRIDE; |
33 | 33 |
34 virtual Availability IsAvailableToContext(const Extension* extension, | 34 virtual Availability IsAvailableToContext(const Extension* extension, |
35 Context context, | 35 Context context, |
36 const GURL& url, | 36 const GURL& url, |
37 Platform platform) const OVERRIDE; | 37 Platform platform) const OVERRIDE; |
38 | 38 |
39 virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; | 39 virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; |
40 virtual bool IsBlockedInServiceWorker() const OVERRIDE; | 40 virtual bool IsBlockedInServiceWorker() const OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
53 | 53 |
54 private: | 54 private: |
55 FeatureList features_; | 55 FeatureList features_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ComplexFeature); | 57 DISALLOW_COPY_AND_ASSIGN(ComplexFeature); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace extensions | 60 } // namespace extensions |
61 | 61 |
62 #endif // EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ | 62 #endif // EXTENSIONS_COMMON_FEATURES_COMPLEX_FEATURE_H_ |
OLD | NEW |