| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BINDING_JS_UTIL_H_ | 5 #ifndef EXTENSIONS_RENDERER_BINDINGS_API_BINDING_JS_UTIL_H_ |
| 6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDING_JS_UTIL_H_ | 6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDING_JS_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const std::string& event_name, | 53 const std::string& event_name, |
| 54 v8::Local<v8::Function> massager); | 54 v8::Local<v8::Function> massager); |
| 55 | 55 |
| 56 // A handler to allow custom bindings to create custom extension API event | 56 // A handler to allow custom bindings to create custom extension API event |
| 57 // objects (e.g. foo.onBar). | 57 // objects (e.g. foo.onBar). |
| 58 // TODO(devlin): Currently, we ignore schema. We may want to take it into | 58 // TODO(devlin): Currently, we ignore schema. We may want to take it into |
| 59 // account. | 59 // account. |
| 60 void CreateCustomEvent(gin::Arguments* arguments, | 60 void CreateCustomEvent(gin::Arguments* arguments, |
| 61 v8::Local<v8::Value> v8_event_name, | 61 v8::Local<v8::Value> v8_event_name, |
| 62 v8::Local<v8::Value> unused_schema, | 62 v8::Local<v8::Value> unused_schema, |
| 63 bool supports_filters); | 63 bool supports_filters, |
| 64 bool supports_lazy_listeners); |
| 64 | 65 |
| 65 // Creates a new declarative event. | 66 // Creates a new declarative event. |
| 66 void CreateCustomDeclarativeEvent( | 67 void CreateCustomDeclarativeEvent( |
| 67 gin::Arguments* arguments, | 68 gin::Arguments* arguments, |
| 68 const std::string& event_name, | 69 const std::string& event_name, |
| 69 const std::vector<std::string>& actions_list, | 70 const std::vector<std::string>& actions_list, |
| 70 const std::vector<std::string>& conditions_list, | 71 const std::vector<std::string>& conditions_list, |
| 71 int webview_instance_id); | 72 int webview_instance_id); |
| 72 | 73 |
| 73 // Invalidates an event, removing its listeners and preventing any more from | 74 // Invalidates an event, removing its listeners and preventing any more from |
| (...skipping 25 matching lines...) Expand all Loading... |
| 99 APIEventHandler* event_handler_; | 100 APIEventHandler* event_handler_; |
| 100 | 101 |
| 101 binding::RunJSFunction run_js_; | 102 binding::RunJSFunction run_js_; |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(APIBindingJSUtil); | 104 DISALLOW_COPY_AND_ASSIGN(APIBindingJSUtil); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace extensions | 107 } // namespace extensions |
| 107 | 108 |
| 108 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDING_JS_UTIL_H_ | 109 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDING_JS_UTIL_H_ |
| OLD | NEW |