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

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: tests and comments Created 7 years, 9 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 virtual std::set<Context>* GetContexts() = 0; 135 virtual std::set<Context>* GetContexts() = 0;
136 136
137 // Returns true if the feature is available to be parsed into a new extension 137 // Returns true if the feature is available to be parsed into a new extension
138 // manifest. 138 // manifest.
139 Availability IsAvailableToManifest(const std::string& extension_id, 139 Availability IsAvailableToManifest(const std::string& extension_id,
140 Manifest::Type type, 140 Manifest::Type type,
141 Location location, 141 Location location,
142 int manifest_version) const { 142 int manifest_version) const {
143 return IsAvailableToManifest(extension_id, type, location, manifest_version, 143 return IsAvailableToManifest(extension_id, type, location, manifest_version,
144 GetCurrentPlatform()); 144 GetCurrentPlatform());
(...skipping 15 matching lines...) Expand all
160 Context context, 160 Context context,
161 const GURL& url, 161 const GURL& url,
162 Platform platform) const = 0; 162 Platform platform) const = 0;
163 163
164 virtual std::string GetAvailabilityMessage(AvailabilityResult result, 164 virtual std::string GetAvailabilityMessage(AvailabilityResult result,
165 Manifest::Type type, 165 Manifest::Type type,
166 const GURL& url) const = 0; 166 const GURL& url) const = 0;
167 167
168 protected: 168 protected:
169 std::string name_; 169 std::string name_;
170 std::set<std::string> dependencies_;
170 }; 171 };
171 172
172 } // namespace extensions 173 } // namespace extensions
173 174
174 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ 175 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698