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

Side by Side Diff: extensions/renderer/api_bindings_system.h

Issue 2768093002: [Reland][Extensions Bindings] Add support for filtered events (Closed)
Patch Set: Fix Created 3 years, 9 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
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_bindings_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_API_BINDINGS_SYSTEM_H_ 5 #ifndef EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_
6 #define EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ 6 #define EXTENSIONS_RENDERER_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Responds to the request with the given |request_id|, calling the callback 60 // Responds to the request with the given |request_id|, calling the callback
61 // with |response|. If |error| is non-empty, sets the last error. 61 // with |response|. If |error| is non-empty, sets the last error.
62 void CompleteRequest(int request_id, 62 void CompleteRequest(int request_id,
63 const base::ListValue& response, 63 const base::ListValue& response,
64 const std::string& error); 64 const std::string& error);
65 65
66 // Notifies the APIEventHandler to fire the corresponding event, notifying 66 // Notifies the APIEventHandler to fire the corresponding event, notifying
67 // listeners. 67 // listeners.
68 void FireEventInContext(const std::string& event_name, 68 void FireEventInContext(const std::string& event_name,
69 v8::Local<v8::Context> context, 69 v8::Local<v8::Context> context,
70 const base::ListValue& response); 70 const base::ListValue& response,
71 const EventFilteringInfo& filter);
71 72
72 // Returns the APIBindingHooks object for the given api to allow for 73 // Returns the APIBindingHooks object for the given api to allow for
73 // registering custom hooks. These must be registered *before* the 74 // registering custom hooks. These must be registered *before* the
74 // binding is instantiated. 75 // binding is instantiated.
75 // TODO(devlin): It's a little weird that we don't just expose a 76 // TODO(devlin): It's a little weird that we don't just expose a
76 // RegisterHooks-type method. Depending on how complex the hook interface 77 // RegisterHooks-type method. Depending on how complex the hook interface
77 // is, maybe we should rethink this. Downside would be that it's less 78 // is, maybe we should rethink this. Downside would be that it's less
78 // efficient to register multiple hooks for the same API. 79 // efficient to register multiple hooks for the same API.
79 APIBindingHooks* GetHooksForAPI(const std::string& api_name); 80 APIBindingHooks* GetHooksForAPI(const std::string& api_name);
80 81
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // The method to retrieve the DictionaryValue describing a given extension 132 // The method to retrieve the DictionaryValue describing a given extension
132 // API. Curried in for testing purposes so we can use fake APIs. 133 // API. Curried in for testing purposes so we can use fake APIs.
133 GetAPISchemaMethod get_api_schema_; 134 GetAPISchemaMethod get_api_schema_;
134 135
135 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); 136 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem);
136 }; 137 };
137 138
138 } // namespace 139 } // namespace
139 140
140 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ 141 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_
OLDNEW
« 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