| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/process_manager.h" | 5 #include "extensions/browser/process_manager.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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 : site_instance_(SiteInstance::Create(context)), | 215 : site_instance_(SiteInstance::Create(context)), |
| 216 startup_background_hosts_created_(false), | 216 startup_background_hosts_created_(false), |
| 217 devtools_callback_(base::Bind( | 217 devtools_callback_(base::Bind( |
| 218 &ProcessManager::OnDevToolsStateChanged, | 218 &ProcessManager::OnDevToolsStateChanged, |
| 219 base::Unretained(this))), | 219 base::Unretained(this))), |
| 220 weak_ptr_factory_(this) { | 220 weak_ptr_factory_(this) { |
| 221 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 221 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
| 222 content::Source<BrowserContext>(original_context)); | 222 content::Source<BrowserContext>(original_context)); |
| 223 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 223 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 224 content::Source<BrowserContext>(original_context)); | 224 content::Source<BrowserContext>(original_context)); |
| 225 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 225 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 226 content::Source<BrowserContext>(original_context)); | 226 content::Source<BrowserContext>(original_context)); |
| 227 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 227 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
| 228 content::Source<BrowserContext>(context)); | 228 content::Source<BrowserContext>(context)); |
| 229 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 229 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
| 230 content::Source<BrowserContext>(context)); | 230 content::Source<BrowserContext>(context)); |
| 231 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, | 231 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
| 232 content::NotificationService::AllSources()); | 232 content::NotificationService::AllSources()); |
| 233 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | 233 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
| 234 content::NotificationService::AllSources()); | 234 content::NotificationService::AllSources()); |
| 235 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, | 235 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 ExtensionSystem* system = ExtensionSystem::Get(context); | 638 ExtensionSystem* system = ExtensionSystem::Get(context); |
| 639 if (system->ready().is_signaled()) { | 639 if (system->ready().is_signaled()) { |
| 640 // The extension system is ready, so create the background host. | 640 // The extension system is ready, so create the background host. |
| 641 const Extension* extension = | 641 const Extension* extension = |
| 642 content::Details<const Extension>(details).ptr(); | 642 content::Details<const Extension>(details).ptr(); |
| 643 CreateBackgroundHostForExtensionLoad(this, extension); | 643 CreateBackgroundHostForExtensionLoad(this, extension); |
| 644 } | 644 } |
| 645 break; | 645 break; |
| 646 } | 646 } |
| 647 | 647 |
| 648 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 648 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: { |
| 649 const Extension* extension = | 649 const Extension* extension = |
| 650 content::Details<UnloadedExtensionInfo>(details)->extension; | 650 content::Details<UnloadedExtensionInfo>(details)->extension; |
| 651 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); | 651 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); |
| 652 iter != background_hosts_.end(); ++iter) { | 652 iter != background_hosts_.end(); ++iter) { |
| 653 ExtensionHost* host = *iter; | 653 ExtensionHost* host = *iter; |
| 654 if (host->extension_id() == extension->id()) { | 654 if (host->extension_id() == extension->id()) { |
| 655 CloseBackgroundHost(host); | 655 CloseBackgroundHost(host); |
| 656 break; | 656 break; |
| 657 } | 657 } |
| 658 } | 658 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 const Extension* extension = | 909 const Extension* extension = |
| 910 registry->enabled_extensions().GetExtensionOrAppByURL(url); | 910 registry->enabled_extensions().GetExtensionOrAppByURL(url); |
| 911 if (extension && !IncognitoInfo::IsSplitMode(extension)) { | 911 if (extension && !IncognitoInfo::IsSplitMode(extension)) { |
| 912 return original_manager_->GetSiteInstanceForURL(url); | 912 return original_manager_->GetSiteInstanceForURL(url); |
| 913 } | 913 } |
| 914 } | 914 } |
| 915 return ProcessManager::GetSiteInstanceForURL(url); | 915 return ProcessManager::GetSiteInstanceForURL(url); |
| 916 } | 916 } |
| 917 | 917 |
| 918 } // namespace extensions | 918 } // namespace extensions |
| OLD | NEW |