| 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_EXTENSION_BINDINGS_SYSTEM_H_ | 5 #ifndef EXTENSIONS_RENDERER_EXTENSION_BINDINGS_SYSTEM_H_ |
| 6 #define EXTENSIONS_RENDERER_EXTENSION_BINDINGS_SYSTEM_H_ | 6 #define EXTENSIONS_RENDERER_EXTENSION_BINDINGS_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual void UpdateBindingsForContext(ScriptContext* context) = 0; | 37 virtual void UpdateBindingsForContext(ScriptContext* context) = 0; |
| 38 | 38 |
| 39 // Dispatches an event with the given |name|, |event_args|, and | 39 // Dispatches an event with the given |name|, |event_args|, and |
| 40 // |filtering_info| in the given |context|. | 40 // |filtering_info| in the given |context|. |
| 41 virtual void DispatchEventInContext( | 41 virtual void DispatchEventInContext( |
| 42 const std::string& event_name, | 42 const std::string& event_name, |
| 43 const base::ListValue* event_args, | 43 const base::ListValue* event_args, |
| 44 const base::DictionaryValue* filtering_info, | 44 const base::DictionaryValue* filtering_info, |
| 45 ScriptContext* context) = 0; | 45 ScriptContext* context) = 0; |
| 46 | 46 |
| 47 // Returns true if there is a listener for the given |event_name| in the |
| 48 // associated |context|. |
| 49 virtual bool HasEventListenerInContext(const std::string& event_name, |
| 50 ScriptContext* context) = 0; |
| 51 |
| 47 // Handles the response associated with the given |request_id|. | 52 // Handles the response associated with the given |request_id|. |
| 48 virtual void HandleResponse(int request_id, | 53 virtual void HandleResponse(int request_id, |
| 49 bool success, | 54 bool success, |
| 50 const base::ListValue& response, | 55 const base::ListValue& response, |
| 51 const std::string& error) = 0; | 56 const std::string& error) = 0; |
| 52 | 57 |
| 53 // Returns the associated RequestSender, if any. | 58 // Returns the associated RequestSender, if any. |
| 54 // TODO(devlin): Factor this out. | 59 // TODO(devlin): Factor this out. |
| 55 virtual RequestSender* GetRequestSender() = 0; | 60 virtual RequestSender* GetRequestSender() = 0; |
| 56 }; | 61 }; |
| 57 | 62 |
| 58 } // namespace extensions | 63 } // namespace extensions |
| 59 | 64 |
| 60 #endif // EXTENSIONS_RENDERER_EXTENSION_BINDINGS_SYSTEM_H_ | 65 #endif // EXTENSIONS_RENDERER_EXTENSION_BINDINGS_SYSTEM_H_ |
| OLD | NEW |