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

Unified Diff: extensions/renderer/api_bindings_system.h

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_bindings_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_bindings_system.h
diff --git a/extensions/renderer/api_bindings_system.h b/extensions/renderer/api_bindings_system.h
index 4b05f24ca09647151c241d68bf253823b60f87e2..b48971ec26ccccfd3b52d2dc326748c21872b261 100644
--- a/extensions/renderer/api_bindings_system.h
+++ b/extensions/renderer/api_bindings_system.h
@@ -12,6 +12,8 @@
#include "base/callback.h"
#include "base/macros.h"
#include "extensions/renderer/api_binding.h"
+#include "extensions/renderer/api_binding_types.h"
+#include "extensions/renderer/api_event_handler.h"
#include "extensions/renderer/api_request_handler.h"
#include "extensions/renderer/argument_spec.h"
@@ -43,7 +45,7 @@ class APIBindingsSystem {
base::Callback<const base::DictionaryValue&(const std::string&)>;
using SendRequestMethod = base::Callback<void(std::unique_ptr<Request>)>;
- APIBindingsSystem(const APIRequestHandler::CallJSFunction& call_js,
+ APIBindingsSystem(const binding::RunJSFunction& call_js,
const GetAPISchemaMethod& get_api_schema,
const SendRequestMethod& send_request);
~APIBindingsSystem();
@@ -60,6 +62,12 @@ class APIBindingsSystem {
void CompleteRequest(const std::string& request_id,
const base::ListValue& response);
+ // Notifies the APIEventHandler to fire the corresponding event, notifying
+ // listeners.
+ void FireEventInContext(const std::string& event_name,
+ v8::Local<v8::Context> context,
+ const base::ListValue& response);
+
private:
// Creates a new APIBinding for the given |api_name|.
std::unique_ptr<APIBinding> CreateNewAPIBinding(const std::string& api_name);
@@ -78,6 +86,9 @@ class APIBindingsSystem {
// The request handler associated with the system.
APIRequestHandler request_handler_;
+ // The event handler associated with the system.
+ APIEventHandler event_handler_;
+
// A map from api_name -> APIBinding for constructed APIs. APIBindings are
// created lazily.
std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_;
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_bindings_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698