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

Side by Side Diff: extensions/common/features/feature.h

Issue 2137463003: [Extensions] Move Feature channel code into //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 EXTENSIONS_COMMON_FEATURES_FEATURE_H_ 5 #ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_H_
6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_H_ 6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Availability IsAvailableToContext(const Extension* extension, 134 Availability IsAvailableToContext(const Extension* extension,
135 Context context, 135 Context context,
136 const GURL& url) const { 136 const GURL& url) const {
137 return IsAvailableToContext(extension, context, url, GetCurrentPlatform()); 137 return IsAvailableToContext(extension, context, url, GetCurrentPlatform());
138 } 138 }
139 virtual Availability IsAvailableToContext(const Extension* extension, 139 virtual Availability IsAvailableToContext(const Extension* extension,
140 Context context, 140 Context context,
141 const GURL& url, 141 const GURL& url,
142 Platform platform) const = 0; 142 Platform platform) const = 0;
143 143
144 virtual std::string GetAvailabilityMessage(AvailabilityResult result,
145 Manifest::Type type,
146 const GURL& url,
147 Context context) const = 0;
148
149 // Returns true if the feature is available to the current environment, 144 // Returns true if the feature is available to the current environment,
150 // without needing to know information about an Extension or any other 145 // without needing to know information about an Extension or any other
151 // contextual information. Typically used when the Feature is purely 146 // contextual information. Typically used when the Feature is purely
152 // configured by command line flags and/or Chrome channel. 147 // configured by command line flags and/or Chrome channel.
153 // 148 //
154 // Generally try not to use this function. Even if you don't think a Feature 149 // Generally try not to use this function. Even if you don't think a Feature
155 // relies on an Extension now - maybe it will, one day, so if there's an 150 // relies on an Extension now - maybe it will, one day, so if there's an
156 // Extension available (or a runtime context, etc) then use the more targeted 151 // Extension available (or a runtime context, etc) then use the more targeted
157 // method instead. 152 // method instead.
158 Availability IsAvailableToEnvironment() const; 153 Availability IsAvailableToEnvironment() const;
159 154
160 virtual bool IsIdInBlacklist(const std::string& extension_id) const = 0; 155 virtual bool IsIdInBlacklist(const std::string& extension_id) const = 0;
161 virtual bool IsIdInWhitelist(const std::string& extension_id) const = 0; 156 virtual bool IsIdInWhitelist(const std::string& extension_id) const = 0;
162 157
163 protected: 158 protected:
164 std::string name_; 159 std::string name_;
165 bool no_parent_; 160 bool no_parent_;
166 }; 161 };
167 162
168 } // namespace extensions 163 } // namespace extensions
169 164
170 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_H_ 165 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698