| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 6 #define EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 6 #define EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void RemoveFilteredEventListener(const std::string& event_name, | 157 void RemoveFilteredEventListener(const std::string& event_name, |
| 158 content::RenderProcessHost* process, | 158 content::RenderProcessHost* process, |
| 159 const std::string& extension_id, | 159 const std::string& extension_id, |
| 160 const base::DictionaryValue& filter, | 160 const base::DictionaryValue& filter, |
| 161 bool remove_lazy_listener); | 161 bool remove_lazy_listener); |
| 162 | 162 |
| 163 // Returns true if there is at least one listener for the given event. | 163 // Returns true if there is at least one listener for the given event. |
| 164 bool HasEventListener(const std::string& event_name); | 164 bool HasEventListener(const std::string& event_name); |
| 165 | 165 |
| 166 // Returns true if the extension is listening to the given event. | 166 // Returns true if the extension is listening to the given event. |
| 167 virtual bool ExtensionHasEventListener(const std::string& extension_id, | 167 bool ExtensionHasEventListener(const std::string& extension_id, |
| 168 const std::string& event_name); | 168 const std::string& event_name); |
| 169 | 169 |
| 170 // Return or set the list of events for which the given extension has | 170 // Return or set the list of events for which the given extension has |
| 171 // registered. | 171 // registered. |
| 172 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); | 172 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); |
| 173 void SetRegisteredEvents(const std::string& extension_id, | 173 void SetRegisteredEvents(const std::string& extension_id, |
| 174 const std::set<std::string>& events); | 174 const std::set<std::string>& events); |
| 175 | 175 |
| 176 // Broadcasts an event to every listener registered for that event. | 176 // Broadcasts an event to every listener registered for that event. |
| 177 virtual void BroadcastEvent(scoped_ptr<Event> event); | 177 virtual void BroadcastEvent(scoped_ptr<Event> event); |
| 178 | 178 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 const std::string event_name; | 429 const std::string event_name; |
| 430 | 430 |
| 431 const std::string extension_id; | 431 const std::string extension_id; |
| 432 const GURL listener_url; | 432 const GURL listener_url; |
| 433 content::BrowserContext* browser_context; | 433 content::BrowserContext* browser_context; |
| 434 }; | 434 }; |
| 435 | 435 |
| 436 } // namespace extensions | 436 } // namespace extensions |
| 437 | 437 |
| 438 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 438 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |