| 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 "chrome/browser/extensions/event_router.h" | 5 #include "chrome/browser/extensions/event_router.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (host->extension() && host->extension()->has_lazy_background_page()) | 516 if (host->extension() && host->extension()->has_lazy_background_page()) |
| 517 pm->DecrementLazyKeepaliveCount(host->extension()); | 517 pm->DecrementLazyKeepaliveCount(host->extension()); |
| 518 } | 518 } |
| 519 | 519 |
| 520 void EventRouter::DispatchPendingEvent(const linked_ptr<Event>& event, | 520 void EventRouter::DispatchPendingEvent(const linked_ptr<Event>& event, |
| 521 ExtensionHost* host) { | 521 ExtensionHost* host) { |
| 522 if (!host) | 522 if (!host) |
| 523 return; | 523 return; |
| 524 | 524 |
| 525 if (listeners_.HasProcessListener(host->render_process_host(), | 525 if (listeners_.HasProcessListener(host->render_process_host(), |
| 526 host->extension()->id())) | 526 host->extension()->id())) { |
| 527 DispatchEventToProcess(host->extension()->id(), | 527 DispatchEventToProcess(host->extension()->id(), |
| 528 host->render_process_host(), event); | 528 host->render_process_host(), event); |
| 529 } |
| 529 } | 530 } |
| 530 | 531 |
| 531 void EventRouter::Observe(int type, | 532 void EventRouter::Observe(int type, |
| 532 const content::NotificationSource& source, | 533 const content::NotificationSource& source, |
| 533 const content::NotificationDetails& details) { | 534 const content::NotificationDetails& details) { |
| 534 switch (type) { | 535 switch (type) { |
| 535 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: | 536 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: |
| 536 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { | 537 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { |
| 537 content::RenderProcessHost* renderer = | 538 content::RenderProcessHost* renderer = |
| 538 content::Source<content::RenderProcessHost>(source).ptr(); | 539 content::Source<content::RenderProcessHost>(source).ptr(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 event_args(event_args.Pass()), | 603 event_args(event_args.Pass()), |
| 603 event_url(event_url), | 604 event_url(event_url), |
| 604 restrict_to_profile(restrict_to_profile), | 605 restrict_to_profile(restrict_to_profile), |
| 605 cross_incognito_args(NULL), | 606 cross_incognito_args(NULL), |
| 606 user_gesture(user_gesture), | 607 user_gesture(user_gesture), |
| 607 info(info) {} | 608 info(info) {} |
| 608 | 609 |
| 609 Event::~Event() {} | 610 Event::~Event() {} |
| 610 | 611 |
| 611 } // namespace extensions | 612 } // namespace extensions |
| OLD | NEW |