Index: extensions/renderer/api_binding.h |
diff --git a/extensions/renderer/api_binding.h b/extensions/renderer/api_binding.h |
index 8e20a97e3a550c9143dcb2bd35af8e72c1181e68..292cdf318c95bcdc2522a4b7962bc3c25ace811e 100644 |
--- a/extensions/renderer/api_binding.h |
+++ b/extensions/renderer/api_binding.h |
@@ -47,9 +47,10 @@ class APIBinding { |
const std::string& property_name, |
const base::ListValue* property_values)>; |
- // The callback for determining if a given API method (specified by |name|) |
- // is available. |
- using AvailabilityCallback = base::Callback<bool(const std::string& name)>; |
+ // The callback for determining if a given API feature (specified by |name|) |
+ // is available in the given context. |
+ using AvailabilityCallback = |
+ base::Callback<bool(v8::Local<v8::Context>, const std::string& name)>; |
// The callback type for handling an API call. |
using HandlerCallback = base::Callback<void(gin::Arguments*)>; |
@@ -63,6 +64,7 @@ class APIBinding { |
const base::ListValue* event_definitions, |
const base::DictionaryValue* property_definitions, |
const CreateCustomType& create_custom_type, |
+ const AvailabilityCallback& is_available, |
std::unique_ptr<APIBindingHooks> binding_hooks, |
APITypeReferenceMap* type_refs, |
APIRequestHandler* request_handler, |
@@ -70,9 +72,7 @@ class APIBinding { |
~APIBinding(); |
// Returns a new v8::Object for the API this APIBinding represents. |
- v8::Local<v8::Object> CreateInstance( |
- v8::Local<v8::Context> context, |
- const AvailabilityCallback& is_available); |
+ v8::Local<v8::Object> CreateInstance(v8::Local<v8::Context> context); |
APIBindingHooks* hooks() { return binding_hooks_.get(); } |
@@ -130,6 +130,9 @@ class APIBinding { |
// The callback for constructing a custom type. |
CreateCustomType create_custom_type_; |
+ // The callback for checking availability of an API feature. |
+ AvailabilityCallback is_available_; |
+ |
// The registered hooks for this API. |
std::unique_ptr<APIBindingHooks> binding_hooks_; |