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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 const extensions::EventFilteringInfo& info); | 226 const extensions::EventFilteringInfo& info); |
227 | 227 |
228 void Observe(int type, | 228 void Observe(int type, |
229 const content::NotificationSource& source, | 229 const content::NotificationSource& source, |
230 const content::NotificationDetails& details) override; | 230 const content::NotificationDetails& details) override; |
231 // ExtensionRegistryObserver implementation. | 231 // ExtensionRegistryObserver implementation. |
232 void OnExtensionLoaded(content::BrowserContext* browser_context, | 232 void OnExtensionLoaded(content::BrowserContext* browser_context, |
233 const Extension* extension) override; | 233 const Extension* extension) override; |
234 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 234 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
235 const Extension* extension, | 235 const Extension* extension, |
236 UnloadedExtensionInfo::Reason reason) override; | 236 UnloadedExtensionReason reason) override; |
237 | 237 |
238 // Returns true if the given listener map contains a event listeners for | 238 // Returns true if the given listener map contains a event listeners for |
239 // the given event. If |extension_id| is non-empty, we also check that that | 239 // the given event. If |extension_id| is non-empty, we also check that that |
240 // extension is one of the listeners. | 240 // extension is one of the listeners. |
241 bool HasEventListenerImpl(const ListenerMap& listeners, | 241 bool HasEventListenerImpl(const ListenerMap& listeners, |
242 const std::string& extension_id, | 242 const std::string& extension_id, |
243 const std::string& event_name); | 243 const std::string& event_name); |
244 | 244 |
245 // Shared by all event dispatch methods. If |restrict_to_extension_id| is | 245 // Shared by all event dispatch methods. If |restrict_to_extension_id| is |
246 // empty, the event is broadcast. An event that just came off the pending | 246 // empty, the event is broadcast. An event that just came off the pending |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 const std::string event_name; | 427 const std::string event_name; |
428 | 428 |
429 const std::string extension_id; | 429 const std::string extension_id; |
430 const GURL listener_url; | 430 const GURL listener_url; |
431 content::BrowserContext* browser_context; | 431 content::BrowserContext* browser_context; |
432 }; | 432 }; |
433 | 433 |
434 } // namespace extensions | 434 } // namespace extensions |
435 | 435 |
436 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 436 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |