Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Side by Side Diff: extensions/browser/event_router.cc

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "extensions/browser/event_router.h" 5 #include "extensions/browser/event_router.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 extension_prefs_(extension_prefs), 163 extension_prefs_(extension_prefs),
164 listeners_(this) { 164 listeners_(this) {
165 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 165 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
166 content::NotificationService::AllSources()); 166 content::NotificationService::AllSources());
167 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, 167 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
168 content::NotificationService::AllSources()); 168 content::NotificationService::AllSources());
169 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, 169 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED,
170 content::Source<BrowserContext>(browser_context_)); 170 content::Source<BrowserContext>(browser_context_));
171 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 171 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
172 content::Source<BrowserContext>(browser_context_)); 172 content::Source<BrowserContext>(browser_context_));
173 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 173 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
174 content::Source<BrowserContext>(browser_context_)); 174 content::Source<BrowserContext>(browser_context_));
175 } 175 }
176 176
177 EventRouter::~EventRouter() {} 177 EventRouter::~EventRouter() {}
178 178
179 void EventRouter::AddEventListener(const std::string& event_name, 179 void EventRouter::AddEventListener(const std::string& event_name,
180 content::RenderProcessHost* process, 180 content::RenderProcessHost* process,
181 const std::string& extension_id) { 181 const std::string& extension_id) {
182 listeners_.AddListener(scoped_ptr<EventListener>(new EventListener( 182 listeners_.AddListener(scoped_ptr<EventListener>(new EventListener(
183 event_name, extension_id, process, scoped_ptr<DictionaryValue>()))); 183 event_name, extension_id, process, scoped_ptr<DictionaryValue>())));
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 std::set<std::string> registered_events = 692 std::set<std::string> registered_events =
693 GetRegisteredEvents(extension->id()); 693 GetRegisteredEvents(extension->id());
694 listeners_.LoadUnfilteredLazyListeners(extension->id(), 694 listeners_.LoadUnfilteredLazyListeners(extension->id(),
695 registered_events); 695 registered_events);
696 const DictionaryValue* filtered_events = 696 const DictionaryValue* filtered_events =
697 GetFilteredEvents(extension->id()); 697 GetFilteredEvents(extension->id());
698 if (filtered_events) 698 if (filtered_events)
699 listeners_.LoadFilteredLazyListeners(extension->id(), *filtered_events); 699 listeners_.LoadFilteredLazyListeners(extension->id(), *filtered_events);
700 break; 700 break;
701 } 701 }
702 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { 702 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
703 // Remove all registered lazy listeners from our cache. 703 // Remove all registered lazy listeners from our cache.
704 UnloadedExtensionInfo* unloaded = 704 UnloadedExtensionInfo* unloaded =
705 content::Details<UnloadedExtensionInfo>(details).ptr(); 705 content::Details<UnloadedExtensionInfo>(details).ptr();
706 listeners_.RemoveLazyListenersForExtension(unloaded->extension->id()); 706 listeners_.RemoveLazyListenersForExtension(unloaded->extension->id());
707 break; 707 break;
708 } 708 }
709 default: 709 default:
710 NOTREACHED(); 710 NOTREACHED();
711 return; 711 return;
712 } 712 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 } 763 }
764 764
765 EventListenerInfo::EventListenerInfo(const std::string& event_name, 765 EventListenerInfo::EventListenerInfo(const std::string& event_name,
766 const std::string& extension_id, 766 const std::string& extension_id,
767 content::BrowserContext* browser_context) 767 content::BrowserContext* browser_context)
768 : event_name(event_name), 768 : event_name(event_name),
769 extension_id(extension_id), 769 extension_id(extension_id),
770 browser_context(browser_context) {} 770 browser_context(browser_context) {}
771 771
772 } // namespace extensions 772 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/api_resource_manager.h ('k') | extensions/browser/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698