| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/browser/extensions/extension_process_manager.h" | 7 #include "chrome/browser/extensions/extension_process_manager.h" |
| 8 | 8 |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "content/browser/browsing_instance.h" | 10 #include "content/browser/browsing_instance.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 | 529 |
| 530 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, | 530 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, |
| 531 bool is_background) { | 531 bool is_background) { |
| 532 DCHECK_EQ(browsing_instance_->browser_context(), host->profile()); | 532 DCHECK_EQ(browsing_instance_->browser_context(), host->profile()); |
| 533 | 533 |
| 534 all_hosts_.insert(host); | 534 all_hosts_.insert(host); |
| 535 if (is_background) | 535 if (is_background) |
| 536 background_hosts_.insert(host); | 536 background_hosts_.insert(host); |
| 537 content::NotificationService::current()->Notify( | |
| 538 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | |
| 539 content::Source<ExtensionProcessManager>(this), | |
| 540 content::Details<ExtensionHost>(host)); | |
| 541 } | 537 } |
| 542 | 538 |
| 543 void ExtensionProcessManager::CloseBackgroundHost(ExtensionHost* host) { | 539 void ExtensionProcessManager::CloseBackgroundHost(ExtensionHost* host) { |
| 544 CHECK(host->extension_host_type() == | 540 CHECK(host->extension_host_type() == |
| 545 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); | 541 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); |
| 546 delete host; | 542 delete host; |
| 547 // |host| should deregister itself from our structures. | 543 // |host| should deregister itself from our structures. |
| 548 CHECK(background_hosts_.find(host) == background_hosts_.end()); | 544 CHECK(background_hosts_.find(host) == background_hosts_.end()); |
| 549 } | 545 } |
| 550 | 546 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 if (service && service->is_ready()) | 673 if (service && service->is_ready()) |
| 678 CreateBackgroundHostsForProfileStartup(this, service->extensions()); | 674 CreateBackgroundHostsForProfileStartup(this, service->extensions()); |
| 679 } | 675 } |
| 680 break; | 676 break; |
| 681 } | 677 } |
| 682 default: | 678 default: |
| 683 ExtensionProcessManager::Observe(type, source, details); | 679 ExtensionProcessManager::Observe(type, source, details); |
| 684 break; | 680 break; |
| 685 } | 681 } |
| 686 } | 682 } |
| OLD | NEW |