Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: chrome/common/extensions/features/complex_feature.h

Issue 11316164: Implement ComplexFeature to support permission features with multiple rules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698