| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ | 5 #ifndef EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ |
| 6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ | 6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const BindingAccessChecker* access_checker)>; | 44 const BindingAccessChecker* access_checker)>; |
| 45 | 45 |
| 46 APIBindingsSystem( | 46 APIBindingsSystem( |
| 47 const binding::RunJSFunction& call_js, | 47 const binding::RunJSFunction& call_js, |
| 48 const binding::RunJSFunctionSync& call_js_sync, | 48 const binding::RunJSFunctionSync& call_js_sync, |
| 49 const GetAPISchemaMethod& get_api_schema, | 49 const GetAPISchemaMethod& get_api_schema, |
| 50 const BindingAccessChecker::AvailabilityCallback& is_available, | 50 const BindingAccessChecker::AvailabilityCallback& is_available, |
| 51 const APIRequestHandler::SendRequestMethod& send_request, | 51 const APIRequestHandler::SendRequestMethod& send_request, |
| 52 const APIEventHandler::EventListenersChangedMethod& | 52 const APIEventHandler::EventListenersChangedMethod& |
| 53 event_listeners_changed, | 53 event_listeners_changed, |
| 54 const APIBinding::OnSilentRequest& on_silent_request, |
| 54 APILastError last_error); | 55 APILastError last_error); |
| 55 ~APIBindingsSystem(); | 56 ~APIBindingsSystem(); |
| 56 | 57 |
| 57 // Returns a new v8::Object representing the api specified by |api_name|. | 58 // Returns a new v8::Object representing the api specified by |api_name|. |
| 58 v8::Local<v8::Object> CreateAPIInstance( | 59 v8::Local<v8::Object> CreateAPIInstance( |
| 59 const std::string& api_name, | 60 const std::string& api_name, |
| 60 v8::Local<v8::Context> context, | 61 v8::Local<v8::Context> context, |
| 61 APIBindingHooks** hooks_out); | 62 APIBindingHooks** hooks_out); |
| 62 | 63 |
| 63 // Responds to the request with the given |request_id|, calling the callback | 64 // Responds to the request with the given |request_id|, calling the callback |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::map<std::string, CustomTypeHandler> custom_types_; | 135 std::map<std::string, CustomTypeHandler> custom_types_; |
| 135 | 136 |
| 136 binding::RunJSFunction call_js_; | 137 binding::RunJSFunction call_js_; |
| 137 | 138 |
| 138 binding::RunJSFunctionSync call_js_sync_; | 139 binding::RunJSFunctionSync call_js_sync_; |
| 139 | 140 |
| 140 // The method to retrieve the DictionaryValue describing a given extension | 141 // The method to retrieve the DictionaryValue describing a given extension |
| 141 // API. Curried in for testing purposes so we can use fake APIs. | 142 // API. Curried in for testing purposes so we can use fake APIs. |
| 142 GetAPISchemaMethod get_api_schema_; | 143 GetAPISchemaMethod get_api_schema_; |
| 143 | 144 |
| 145 // The method to call when the system silently handles an API request without |
| 146 // notifying the browser. |
| 147 APIBinding::OnSilentRequest on_silent_request_; |
| 148 |
| 144 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); | 149 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); |
| 145 }; | 150 }; |
| 146 | 151 |
| 147 } // namespace | 152 } // namespace |
| 148 | 153 |
| 149 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ | 154 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_H_ |
| OLD | NEW |