Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_COMPLEX_FEATURE_H_ | |
| 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_COMPLEX_FEATURE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "chrome/common/extensions/extension.h" | |
| 12 #include "chrome/common/extensions/features/feature.h" | |
| 13 #include "chrome/common/extensions/features/permission_feature.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 // A ComplexFeature is composed of one or many SimpleFeatures. Currently, we | |
| 18 // only support PermissionFeatures. A ComplexFeature is available if any | |
|
not at google - send to devlin
2012/12/12 17:42:41
"we only support PermissionFeatures" -> is there a
justinlin
2012/12/14 12:26:26
Done. Removed.
| |
| 19 // SimpleFeature (i.e. a permission rule) that composes it is available, but not | |
| 20 // if only some combination of SimpleFeatures is available. | |
| 21 class ComplexFeature : public Feature { | |
| 22 public: | |
| 23 ComplexFeature(); | |
| 24 virtual ~ComplexFeature(); | |
| 25 | |
| 26 // Adds a SimpleFeature to the list that composes this ComplexFeature. | |
|
not at google - send to devlin
2012/12/12 17:42:41
SimpleFeature -> Feature. In any case, is it possi
justinlin
2012/12/14 12:26:26
Done.
| |
| 27 void AddSimpleFeature(const PermissionFeature* feature); | |
|
not at google - send to devlin
2012/12/12 17:42:41
PermissionFeature -> Feature, take a scoped_ptr<Fe
justinlin
2012/12/14 12:26:26
Done.
| |
| 28 | |
| 29 // extensions::Feature: | |
| 30 virtual Availability IsAvailableToManifest(const std::string& extension_id, | |
| 31 Extension::Type type, | |
| 32 Location location, | |
| 33 int manifest_version, | |
| 34 Platform platform) const OVERRIDE; | |
| 35 virtual Availability IsAvailableToContext(const Extension* extension, | |
| 36 Context context, | |
| 37 Platform platform) const OVERRIDE; | |
| 38 virtual std::string GetAvailabilityMessage( | |
| 39 AvailabilityResult result, | |
| 40 Extension::Type type) const OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 typedef std::vector<PermissionFeature> SimpleFeatureList; | |
|
not at google - send to devlin
2012/12/12 17:42:41
PermissionFeature -> Feature
justinlin
2012/12/14 12:26:26
Done.
| |
| 44 SimpleFeatureList simple_features_; | |
|
not at google - send to devlin
2012/12/12 17:42:41
DISALLOW_COPY_AND_ASSIGN
This might be an interes
justinlin
2012/12/14 12:26:26
Done. Since we pretty much never reference Complex
| |
| 45 }; | |
| 46 | |
| 47 } // namespace extensions | |
| 48 | |
| 49 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_COMPLEX_FEATURE_H_ | |
| OLD | NEW |