Chromium Code Reviews| Index: extensions/common/extension_api.h |
| diff --git a/extensions/common/extension_api.h b/extensions/common/extension_api.h |
| index 1453340a50e57fce64ba9fd3f5687a500f29feaa..e97813d2b39cdcaf4a53fda205f408c6df745635 100644 |
| --- a/extensions/common/extension_api.h |
| +++ b/extensions/common/extension_api.h |
| @@ -86,20 +86,29 @@ class ExtensionAPI { |
| // |extension| or |url| (or both) may determine its availability, but this is |
| // up to the configuration of the individual feature. |
| // |
| + // |allow_alias| determines whether it should be tested whether the API |
| + // is available through an alias. |
| + // |
| // TODO(kalman): This is just an unnecessary combination of finding a Feature |
| // then calling Feature::IsAvailableToContext(..) on it. Just provide that |
| // FindFeature function and let callers compose if they want. |
| Feature::Availability IsAvailable(const std::string& api_full_name, |
| const Extension* extension, |
| Feature::Context context, |
| - const GURL& url); |
| + const GURL& url, |
| + bool allow_alias); |
|
Devlin
2016/11/14 18:03:56
I think this would be more clear with an enum, ALL
tbarzic
2016/11/15 04:45:07
Done.
|
| - // Determines whether an API, or any parts of that API, are available in |
| + // Determines whether an API, or any parts of that API, can be exposed to |
| // |context|. |
| + // |
| + // |allow_alias| determines whether it should be tested whether the API |
| + // is available through an alias. |
| + // |
| bool IsAnyFeatureAvailableToContext(const Feature& api, |
| const Extension* extension, |
| Feature::Context context, |
| - const GURL& url); |
| + const GURL& url, |
| + bool allow_alias); |
|
Devlin
2016/11/14 18:03:56
ditto
tbarzic
2016/11/15 04:45:07
Done.
|
| // Gets the StringPiece for the schema specified by |api_name|. |
| base::StringPiece GetSchemaStringPiece(const std::string& api_name); |
| @@ -136,6 +145,14 @@ class ExtensionAPI { |
| // testing purposes. |
| virtual bool IsKnownAPI(const std::string& name, ExtensionsClient* client); |
| + // Checks if |full_name| is available to provided context and extension under |
| + // associated API's alias name. |
| + Feature::Availability IsAliasAvailable(const std::string& full_name, |
| + Feature* api, |
| + const Extension* extension, |
| + Feature::Context context, |
| + const GURL& url); |
| + |
| bool default_configuration_initialized_; |
| // Loads a schema. |