| 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 "chrome/browser/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_process_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser_window.h" | 7 #include "chrome/browser/ui/browser_window.h" |
| 8 #include "content/browser/browsing_instance.h" | 8 #include "content/browser/browsing_instance.h" |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include "chrome/browser/extensions/extension_host_mac.h" | 10 #include "chrome/browser/extensions/extension_host_mac.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 : browsing_instance_(new BrowsingInstance(profile)) { | 89 : browsing_instance_(new BrowsingInstance(profile)) { |
| 90 Profile* original_profile = profile->GetOriginalProfile(); | 90 Profile* original_profile = profile->GetOriginalProfile(); |
| 91 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 91 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
| 92 Source<Profile>(original_profile)); | 92 Source<Profile>(original_profile)); |
| 93 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 93 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 94 Source<Profile>(original_profile)); | 94 Source<Profile>(original_profile)); |
| 95 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 95 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 96 Source<Profile>(original_profile)); | 96 Source<Profile>(original_profile)); |
| 97 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 97 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
| 98 Source<Profile>(profile)); | 98 Source<Profile>(profile)); |
| 99 // We can listen to everything for SITE_INSTANCE_DELETED because we check the |
| 100 // |site_instance_id| in UnregisterExtensionSiteInstance. |
| 99 registrar_.Add(this, content::NOTIFICATION_SITE_INSTANCE_DELETED, | 101 registrar_.Add(this, content::NOTIFICATION_SITE_INSTANCE_DELETED, |
| 100 NotificationService::AllSources()); | 102 NotificationService::AllBrowserContextsAndSources()); |
| 101 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, | 103 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, |
| 102 NotificationService::AllSources()); | 104 NotificationService::AllSources()); |
| 103 } | 105 } |
| 104 | 106 |
| 105 ExtensionProcessManager::~ExtensionProcessManager() { | 107 ExtensionProcessManager::~ExtensionProcessManager() { |
| 106 VLOG_IF(1, g_log_bug53991) << "~ExtensionProcessManager: " << this; | 108 VLOG_IF(1, g_log_bug53991) << "~ExtensionProcessManager: " << this; |
| 107 CloseBackgroundHosts(); | 109 CloseBackgroundHosts(); |
| 108 DCHECK(background_hosts_.empty()); | 110 DCHECK(background_hosts_.empty()); |
| 109 } | 111 } |
| 110 | 112 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (service && service->is_ready()) | 484 if (service && service->is_ready()) |
| 483 CreateBackgroundHosts(this, service->extensions()); | 485 CreateBackgroundHosts(this, service->extensions()); |
| 484 } | 486 } |
| 485 break; | 487 break; |
| 486 } | 488 } |
| 487 default: | 489 default: |
| 488 ExtensionProcessManager::Observe(type, source, details); | 490 ExtensionProcessManager::Observe(type, source, details); |
| 489 break; | 491 break; |
| 490 } | 492 } |
| 491 } | 493 } |
| OLD | NEW |