| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
| 18 #include "extensions/common/features/feature.h" | 18 #include "extensions/common/features/feature.h" |
| 19 #include "extensions/common/features/simple_feature_filter.h" | 19 #include "extensions/common/features/simple_feature_filter.h" |
| 20 #include "extensions/common/manifest.h" | 20 #include "extensions/common/manifest.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 class SimpleFeature : public Feature { | 24 class SimpleFeature : public Feature { |
| 25 public: | 25 public: |
| 26 SimpleFeature(); | 26 SimpleFeature(); |
| 27 ~SimpleFeature() override; | 27 ~SimpleFeature() override; |
| 28 | 28 |
| 29 // Similar to Manifest::Location, these are the classes of locations | 29 // Similar to Manifest::Location, these are the classes of locations |
| 30 // supported in feature files; "component" implies | 30 // supported in feature files. |
| 31 // COMPONENT/EXTERNAL_COMPONENT manifest location types, etc. | |
| 32 // | 31 // |
| 33 // This is only public for testing. Production code should never access it, | 32 // This is only public for testing. Production code should never access it, |
| 34 // nor should it really have any reason to access the SimpleFeature class | 33 // nor should it really have any reason to access the SimpleFeature class |
| 35 // directly, it should be dealing with the Feature interface. | 34 // directly, it should be dealing with the Feature interface. |
| 36 enum Location { | 35 enum Location { |
| 37 UNSPECIFIED_LOCATION, | 36 UNSPECIFIED_LOCATION, |
| 38 COMPONENT_LOCATION, | 37 COMPONENT_LOCATION, |
| 38 EXTERNAL_COMPONENT_LOCATION, |
| 39 POLICY_LOCATION, | 39 POLICY_LOCATION, |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Accessors defined for testing. See comment above about not directly using | 42 // Accessors defined for testing. See comment above about not directly using |
| 43 // SimpleFeature in production code. | 43 // SimpleFeature in production code. |
| 44 std::set<std::string>* blacklist() { return &blacklist_; } | 44 std::set<std::string>* blacklist() { return &blacklist_; } |
| 45 std::set<std::string>* whitelist() { return &whitelist_; } | 45 std::set<std::string>* whitelist() { return &whitelist_; } |
| 46 std::set<Manifest::Type>* extension_types() { return &extension_types_; } | 46 std::set<Manifest::Type>* extension_types() { return &extension_types_; } |
| 47 std::set<Context>* contexts() { return &contexts_; } | 47 std::set<Context>* contexts() { return &contexts_; } |
| 48 Location location() const { return location_; } | 48 Location location() const { return location_; } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 typedef std::vector<linked_ptr<SimpleFeatureFilter> > FilterList; | 152 typedef std::vector<linked_ptr<SimpleFeatureFilter> > FilterList; |
| 153 FilterList filters_; | 153 FilterList filters_; |
| 154 | 154 |
| 155 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 155 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace extensions | 158 } // namespace extensions |
| 159 | 159 |
| 160 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 160 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
| OLD | NEW |