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 #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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 } | 532 } |
533 } | 533 } |
534 | 534 |
535 void EventRouter::DispatchEventToProcess(const std::string& extension_id, | 535 void EventRouter::DispatchEventToProcess(const std::string& extension_id, |
536 const GURL& listener_url, | 536 const GURL& listener_url, |
537 content::RenderProcessHost* process, | 537 content::RenderProcessHost* process, |
538 const linked_ptr<Event>& event) { | 538 const linked_ptr<Event>& event) { |
539 BrowserContext* listener_context = process->GetBrowserContext(); | 539 BrowserContext* listener_context = process->GetBrowserContext(); |
540 ProcessMap* process_map = ProcessMap::Get(listener_context); | 540 ProcessMap* process_map = ProcessMap::Get(listener_context); |
541 | 541 |
542 // TODO(kalman): Convert this method to use ProcessMap::GuessContextType. | 542 // TODO(kalman): Convert this method to use |
| 543 // ProcessMap::GetMostLikelyContextType. |
543 | 544 |
544 const Extension* extension = | 545 const Extension* extension = |
545 ExtensionRegistry::Get(browser_context_)->enabled_extensions().GetByID( | 546 ExtensionRegistry::Get(browser_context_)->enabled_extensions().GetByID( |
546 extension_id); | 547 extension_id); |
547 // NOTE: |extension| being NULL does not necessarily imply that this event | 548 // NOTE: |extension| being NULL does not necessarily imply that this event |
548 // shouldn't be dispatched. Events can be dispatched to WebUI as well. | 549 // shouldn't be dispatched. Events can be dispatched to WebUI as well. |
549 | 550 |
550 if (!extension && !extension_id.empty()) { | 551 if (!extension && !extension_id.empty()) { |
551 // Trying to dispatch an event to an extension that doesn't exist. The | 552 // Trying to dispatch an event to an extension that doesn't exist. The |
552 // extension could have been removed, but we do not unregister it until the | 553 // extension could have been removed, but we do not unregister it until the |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 const std::string& extension_id, | 813 const std::string& extension_id, |
813 const GURL& listener_url, | 814 const GURL& listener_url, |
814 content::BrowserContext* browser_context) | 815 content::BrowserContext* browser_context) |
815 : event_name(event_name), | 816 : event_name(event_name), |
816 extension_id(extension_id), | 817 extension_id(extension_id), |
817 listener_url(listener_url), | 818 listener_url(listener_url), |
818 browser_context(browser_context) { | 819 browser_context(browser_context) { |
819 } | 820 } |
820 | 821 |
821 } // namespace extensions | 822 } // namespace extensions |
OLD | NEW |