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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 IPC::Sender* ipc_sender, | 203 IPC::Sender* ipc_sender, |
204 void* browser_context_id, | 204 void* browser_context_id, |
205 const std::string& extension_id, | 205 const std::string& extension_id, |
206 const std::string& event_name, | 206 const std::string& event_name, |
207 base::ListValue* event_args, | 207 base::ListValue* event_args, |
208 UserGestureState user_gesture, | 208 UserGestureState user_gesture, |
209 const extensions::EventFilteringInfo& info); | 209 const extensions::EventFilteringInfo& info); |
210 | 210 |
211 virtual void Observe(int type, | 211 virtual void Observe(int type, |
212 const content::NotificationSource& source, | 212 const content::NotificationSource& source, |
213 const content::NotificationDetails& details) OVERRIDE; | 213 const content::NotificationDetails& details) override; |
214 // ExtensionRegistryObserver implementation. | 214 // ExtensionRegistryObserver implementation. |
215 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 215 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
216 const Extension* extension) OVERRIDE; | 216 const Extension* extension) override; |
217 virtual void OnExtensionUnloaded( | 217 virtual void OnExtensionUnloaded( |
218 content::BrowserContext* browser_context, | 218 content::BrowserContext* browser_context, |
219 const Extension* extension, | 219 const Extension* extension, |
220 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 220 UnloadedExtensionInfo::Reason reason) override; |
221 | 221 |
222 // Returns true if the given listener map contains a event listeners for | 222 // Returns true if the given listener map contains a event listeners for |
223 // the given event. If |extension_id| is non-empty, we also check that that | 223 // the given event. If |extension_id| is non-empty, we also check that that |
224 // extension is one of the listeners. | 224 // extension is one of the listeners. |
225 bool HasEventListenerImpl(const ListenerMap& listeners, | 225 bool HasEventListenerImpl(const ListenerMap& listeners, |
226 const std::string& extension_id, | 226 const std::string& extension_id, |
227 const std::string& event_name); | 227 const std::string& event_name); |
228 | 228 |
229 // Shared by DispatchEvent*. If |restrict_to_extension_id| is empty, the | 229 // Shared by DispatchEvent*. If |restrict_to_extension_id| is empty, the |
230 // event is broadcast. | 230 // event is broadcast. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 // static | 286 // static |
287 static void IncrementInFlightEventsOnUI( | 287 static void IncrementInFlightEventsOnUI( |
288 void* browser_context_id, | 288 void* browser_context_id, |
289 const std::string& extension_id); | 289 const std::string& extension_id); |
290 | 290 |
291 void DispatchPendingEvent(const linked_ptr<Event>& event, | 291 void DispatchPendingEvent(const linked_ptr<Event>& event, |
292 ExtensionHost* host); | 292 ExtensionHost* host); |
293 | 293 |
294 // Implementation of EventListenerMap::Delegate. | 294 // Implementation of EventListenerMap::Delegate. |
295 virtual void OnListenerAdded(const EventListener* listener) OVERRIDE; | 295 virtual void OnListenerAdded(const EventListener* listener) override; |
296 virtual void OnListenerRemoved(const EventListener* listener) OVERRIDE; | 296 virtual void OnListenerRemoved(const EventListener* listener) override; |
297 | 297 |
298 content::BrowserContext* browser_context_; | 298 content::BrowserContext* browser_context_; |
299 | 299 |
300 // The ExtensionPrefs associated with |browser_context_|. May be NULL in | 300 // The ExtensionPrefs associated with |browser_context_|. May be NULL in |
301 // tests. | 301 // tests. |
302 ExtensionPrefs* extension_prefs_; | 302 ExtensionPrefs* extension_prefs_; |
303 | 303 |
304 content::NotificationRegistrar registrar_; | 304 content::NotificationRegistrar registrar_; |
305 | 305 |
306 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 306 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 const std::string event_name; | 382 const std::string event_name; |
383 | 383 |
384 const std::string extension_id; | 384 const std::string extension_id; |
385 const GURL listener_url; | 385 const GURL listener_url; |
386 content::BrowserContext* browser_context; | 386 content::BrowserContext* browser_context; |
387 }; | 387 }; |
388 | 388 |
389 } // namespace extensions | 389 } // namespace extensions |
390 | 390 |
391 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 391 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |