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

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

Issue 242613004: Replace NOTIFICATION_EXTENSION_LOADED to NOTIFICATION_EXTENSION_LOADED_DEPRECATED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ExtensionPrefs* extension_prefs) 166 ExtensionPrefs* extension_prefs)
167 : browser_context_(browser_context), 167 : browser_context_(browser_context),
168 extension_prefs_(extension_prefs), 168 extension_prefs_(extension_prefs),
169 listeners_(this) { 169 listeners_(this) {
170 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 170 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
171 content::NotificationService::AllSources()); 171 content::NotificationService::AllSources());
172 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, 172 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
173 content::NotificationService::AllSources()); 173 content::NotificationService::AllSources());
174 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, 174 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED,
175 content::Source<BrowserContext>(browser_context_)); 175 content::Source<BrowserContext>(browser_context_));
176 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 176 registrar_.Add(this,
177 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
177 content::Source<BrowserContext>(browser_context_)); 178 content::Source<BrowserContext>(browser_context_));
178 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, 179 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
179 content::Source<BrowserContext>(browser_context_)); 180 content::Source<BrowserContext>(browser_context_));
180 } 181 }
181 182
182 EventRouter::~EventRouter() {} 183 EventRouter::~EventRouter() {}
183 184
184 void EventRouter::AddEventListener(const std::string& event_name, 185 void EventRouter::AddEventListener(const std::string& event_name,
185 content::RenderProcessHost* process, 186 content::RenderProcessHost* process,
186 const std::string& extension_id) { 187 const std::string& extension_id) {
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 const Extension* extension = 684 const Extension* extension =
684 content::Details<const Extension>(details).ptr(); 685 content::Details<const Extension>(details).ptr();
685 if (BackgroundInfo::HasLazyBackgroundPage(extension)) { 686 if (BackgroundInfo::HasLazyBackgroundPage(extension)) {
686 LazyBackgroundTaskQueue* queue = ExtensionSystem::Get( 687 LazyBackgroundTaskQueue* queue = ExtensionSystem::Get(
687 browser_context_)->lazy_background_task_queue(); 688 browser_context_)->lazy_background_task_queue();
688 queue->AddPendingTask(browser_context_, extension->id(), 689 queue->AddPendingTask(browser_context_, extension->id(),
689 base::Bind(&DoNothing)); 690 base::Bind(&DoNothing));
690 } 691 }
691 break; 692 break;
692 } 693 }
693 case chrome::NOTIFICATION_EXTENSION_LOADED: { 694 case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
694 // Add all registered lazy listeners to our cache. 695 // Add all registered lazy listeners to our cache.
695 const Extension* extension = 696 const Extension* extension =
696 content::Details<const Extension>(details).ptr(); 697 content::Details<const Extension>(details).ptr();
697 std::set<std::string> registered_events = 698 std::set<std::string> registered_events =
698 GetRegisteredEvents(extension->id()); 699 GetRegisteredEvents(extension->id());
699 listeners_.LoadUnfilteredLazyListeners(extension->id(), 700 listeners_.LoadUnfilteredLazyListeners(extension->id(),
700 registered_events); 701 registered_events);
701 const DictionaryValue* filtered_events = 702 const DictionaryValue* filtered_events =
702 GetFilteredEvents(extension->id()); 703 GetFilteredEvents(extension->id());
703 if (filtered_events) 704 if (filtered_events)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 } 769 }
769 770
770 EventListenerInfo::EventListenerInfo(const std::string& event_name, 771 EventListenerInfo::EventListenerInfo(const std::string& event_name,
771 const std::string& extension_id, 772 const std::string& extension_id,
772 content::BrowserContext* browser_context) 773 content::BrowserContext* browser_context)
773 : event_name(event_name), 774 : event_name(event_name),
774 extension_id(extension_id), 775 extension_id(extension_id),
775 browser_context(browser_context) {} 776 browser_context(browser_context) {}
776 777
777 } // namespace extensions 778 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698