| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 // (or an incognito profile from this profile) is ready. | 587 // (or an incognito profile from this profile) is ready. |
| 588 if (DeferLoadingBackgroundHosts()) | 588 if (DeferLoadingBackgroundHosts()) |
| 589 break; | 589 break; |
| 590 | 590 |
| 591 CreateBackgroundHostsForProfileStartup(); | 591 CreateBackgroundHostsForProfileStartup(); |
| 592 break; | 592 break; |
| 593 } | 593 } |
| 594 | 594 |
| 595 case chrome::NOTIFICATION_EXTENSION_LOADED: { | 595 case chrome::NOTIFICATION_EXTENSION_LOADED: { |
| 596 BrowserContext* context = content::Source<BrowserContext>(source).ptr(); | 596 BrowserContext* context = content::Source<BrowserContext>(source).ptr(); |
| 597 ExtensionService* service = | 597 ExtensionSystem* system = ExtensionSystem::GetForBrowserContext(context); |
| 598 ExtensionSystem::GetForBrowserContext(context)->extension_service(); | 598 if (system->ready().is_signaled()) { |
| 599 if (service->is_ready()) { | 599 // The extension system is ready, so create the background host. |
| 600 const Extension* extension = | 600 const Extension* extension = |
| 601 content::Details<const Extension>(details).ptr(); | 601 content::Details<const Extension>(details).ptr(); |
| 602 CreateBackgroundHostForExtensionLoad(this, extension); | 602 CreateBackgroundHostForExtensionLoad(this, extension); |
| 603 } | 603 } |
| 604 break; | 604 break; |
| 605 } | 605 } |
| 606 | 606 |
| 607 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 607 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
| 608 const Extension* extension = | 608 const Extension* extension = |
| 609 content::Details<UnloadedExtensionInfo>(details)->extension; | 609 content::Details<UnloadedExtensionInfo>(details)->extension; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 } | 873 } |
| 874 | 874 |
| 875 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { | 875 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { |
| 876 // Keep in sync with duplicate in extension_info_map.cc. | 876 // Keep in sync with duplicate in extension_info_map.cc. |
| 877 ExtensionService* service = ExtensionSystem::GetForBrowserContext( | 877 ExtensionService* service = ExtensionSystem::GetForBrowserContext( |
| 878 GetBrowserContext())->extension_service(); | 878 GetBrowserContext())->extension_service(); |
| 879 return extension_util::IsIncognitoEnabled(extension->id(), service); | 879 return extension_util::IsIncognitoEnabled(extension->id(), service); |
| 880 } | 880 } |
| 881 | 881 |
| 882 } // namespace extensions | 882 } // namespace extensions |
| OLD | NEW |