OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const std::string& event_name, | 94 const std::string& event_name, |
95 const std::string& event_args, | 95 const std::string& event_args, |
96 Profile* restrict_to_profile, | 96 Profile* restrict_to_profile, |
97 const std::string& cross_incognito_args, | 97 const std::string& cross_incognito_args, |
98 const GURL& event_url); | 98 const GURL& event_url); |
99 | 99 |
100 private: | 100 private: |
101 // An extension listening to an event. | 101 // An extension listening to an event. |
102 struct EventListener; | 102 struct EventListener; |
103 | 103 |
104 virtual void Observe(NotificationType type, | 104 virtual void Observe(int type, |
105 const NotificationSource& source, | 105 const NotificationSource& source, |
106 const NotificationDetails& details); | 106 const NotificationDetails& details); |
107 | 107 |
108 Profile* profile_; | 108 Profile* profile_; |
109 | 109 |
110 NotificationRegistrar registrar_; | 110 NotificationRegistrar registrar_; |
111 | 111 |
112 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; | 112 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; |
113 | 113 |
114 // A map between an event name and a set of extensions that are listening | 114 // A map between an event name and a set of extensions that are listening |
115 // to that event. | 115 // to that event. |
116 typedef std::map<std::string, std::set<EventListener> > ListenerMap; | 116 typedef std::map<std::string, std::set<EventListener> > ListenerMap; |
117 ListenerMap listeners_; | 117 ListenerMap listeners_; |
118 | 118 |
119 DISALLOW_COPY_AND_ASSIGN(ExtensionEventRouter); | 119 DISALLOW_COPY_AND_ASSIGN(ExtensionEventRouter); |
120 }; | 120 }; |
121 | 121 |
122 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ | 122 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
OLD | NEW |