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

Side by Side Diff: chrome/common/extensions/features/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: 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_FEATURE_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ~ScopedCurrentChannel() { 117 ~ScopedCurrentChannel() {
118 SetCurrentChannel(original_channel_); 118 SetCurrentChannel(original_channel_);
119 } 119 }
120 120
121 private: 121 private:
122 chrome::VersionInfo::Channel original_channel_; 122 chrome::VersionInfo::Channel original_channel_;
123 }; 123 };
124 124
125 const std::string& name() const { return name_; } 125 const std::string& name() const { return name_; }
126 void set_name(const std::string& name) { name_ = name; } 126 void set_name(const std::string& name) { name_ = name; }
127 const std::set<std::string>& dependencies() { return dependencies_; }
127 128
128 // Gets the platform the code is currently running on. 129 // Gets the platform the code is currently running on.
129 static Platform GetCurrentPlatform(); 130 static Platform GetCurrentPlatform();
130 131
131 // Gets the Feature::Location value for the specified Manifest::Location. 132 // Gets the Feature::Location value for the specified Manifest::Location.
132 static Location ConvertLocation(Manifest::Location extension_location); 133 static Location ConvertLocation(Manifest::Location extension_location);
133 134
134 // TODO(justinlin): Remove and move to APIFeature when it exists. 135 // TODO(justinlin): Remove and move to APIFeature when it exists.
135 virtual std::set<Context>* GetContexts() = 0; 136 virtual std::set<Context>* GetContexts() = 0;
not at google - send to devlin 2013/03/26 00:34:48 i guess we're here now, but I kind of prefer keepi
cduvall 2013/03/26 19:24:05 Done.
136 137
137 // Returns true if the feature is available to be parsed into a new extension 138 // Returns true if the feature is available to be parsed into a new extension
138 // manifest. 139 // manifest.
139 Availability IsAvailableToManifest(const std::string& extension_id, 140 Availability IsAvailableToManifest(const std::string& extension_id,
140 Manifest::Type type, 141 Manifest::Type type,
141 Location location, 142 Location location,
142 int manifest_version) const { 143 int manifest_version) const {
143 return IsAvailableToManifest(extension_id, type, location, manifest_version, 144 return IsAvailableToManifest(extension_id, type, location, manifest_version,
144 GetCurrentPlatform()); 145 GetCurrentPlatform());
145 } 146 }
(...skipping 14 matching lines...) Expand all
160 Context context, 161 Context context,
161 const GURL& url, 162 const GURL& url,
162 Platform platform) const = 0; 163 Platform platform) const = 0;
163 164
164 virtual std::string GetAvailabilityMessage(AvailabilityResult result, 165 virtual std::string GetAvailabilityMessage(AvailabilityResult result,
165 Manifest::Type type, 166 Manifest::Type type,
166 const GURL& url) const = 0; 167 const GURL& url) const = 0;
167 168
168 protected: 169 protected:
169 std::string name_; 170 std::string name_;
171 std::set<std::string> dependencies_;
170 }; 172 };
171 173
172 } // namespace extensions 174 } // namespace extensions
173 175
174 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ 176 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698