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

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

Issue 12846011: Implement API features for the Extension API feature system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed memory leak Created 7 years, 8 months 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 12 matching lines...) Expand all
23 public: 23 public:
24 SimpleFeature(); 24 SimpleFeature();
25 SimpleFeature(const SimpleFeature& other); 25 SimpleFeature(const SimpleFeature& other);
26 virtual ~SimpleFeature(); 26 virtual ~SimpleFeature();
27 27
28 std::set<std::string>* whitelist() { return &whitelist_; } 28 std::set<std::string>* whitelist() { return &whitelist_; }
29 std::set<Manifest::Type>* extension_types() { return &extension_types_; } 29 std::set<Manifest::Type>* extension_types() { return &extension_types_; }
30 30
31 // Parses the JSON representation of a feature into the fields of this object. 31 // Parses the JSON representation of a feature into the fields of this object.
32 // Unspecified values in the JSON are not modified in the object. This allows 32 // Unspecified values in the JSON are not modified in the object. This allows
33 // us to implement inheritance by parsing one value after another. 33 // us to implement inheritance by parsing one value after another. Returns
34 void Parse(const DictionaryValue* value); 34 // the error found, or an empty string on success.
35 virtual std::string Parse(const DictionaryValue* value);
35 36
36 // Returns true if the feature contains the same values as another. 37 // Returns true if the feature contains the same values as another.
37 bool Equals(const SimpleFeature& other) const; 38 bool Equals(const SimpleFeature& other) const;
38 39
39 Location location() const { return location_; } 40 Location location() const { return location_; }
40 void set_location(Location location) { location_ = location; } 41 void set_location(Location location) { location_ = location; }
41 42
42 Platform platform() const { return platform_; } 43 Platform platform() const { return platform_; }
43 void set_platform(Platform platform) { platform_ = platform; } 44 void set_platform(Platform platform) { platform_ = platform; }
44 45
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 int min_manifest_version_; 108 int min_manifest_version_;
108 int max_manifest_version_; 109 int max_manifest_version_;
109 chrome::VersionInfo::Channel channel_; 110 chrome::VersionInfo::Channel channel_;
110 111
111 FRIEND_TEST_ALL_PREFIXES(ExtensionSimpleFeatureTest, Context); 112 FRIEND_TEST_ALL_PREFIXES(ExtensionSimpleFeatureTest, Context);
112 }; 113 };
113 114
114 } // namespace extensions 115 } // namespace extensions
115 116
116 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ 117 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/permission_feature.cc ('k') | chrome/common/extensions/features/simple_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698