| Index: chrome/browser/extensions/extension_service.cc
 | 
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
 | 
| index 6923e15d854cedb5979ac5ab97de410f9f1b257a..1af45fd725d568b37fdf634ccdef3f6aaf85cb3f 100644
 | 
| --- a/chrome/browser/extensions/extension_service.cc
 | 
| +++ b/chrome/browser/extensions/extension_service.cc
 | 
| @@ -53,6 +53,8 @@
 | 
|  #include "chrome/browser/extensions/extension_sorting.h"
 | 
|  #include "chrome/browser/extensions/extension_special_storage_policy.h"
 | 
|  #include "chrome/browser/extensions/extension_sync_data.h"
 | 
| +#include "chrome/browser/extensions/extension_system.h"
 | 
| +#include "chrome/browser/extensions/extension_system_factory.h"
 | 
|  #include "chrome/browser/extensions/extension_web_ui.h"
 | 
|  #include "chrome/browser/extensions/extension_webnavigation_api.h"
 | 
|  #include "chrome/browser/extensions/external_extension_provider_impl.h"
 | 
| @@ -377,6 +379,7 @@ ExtensionService::ExtensionService(Profile* profile,
 | 
|                                     bool autoupdate_enabled,
 | 
|                                     bool extensions_enabled)
 | 
|      : profile_(profile),
 | 
| +      system_(ExtensionSystemFactory::GetForProfile(profile)),
 | 
|        extension_prefs_(extension_prefs),
 | 
|        settings_frontend_(extensions::SettingsFrontend::Create(profile)),
 | 
|        pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)),
 | 
| @@ -700,7 +703,8 @@ void ExtensionService::ReloadExtension(const std::string& extension_id) {
 | 
|      // If the extension has an inspector open for its background page, detach
 | 
|      // the inspector and hang onto a cookie for it, so that we can reattach
 | 
|      // later.
 | 
| -    ExtensionProcessManager* manager = profile_->GetExtensionProcessManager();
 | 
| +    // TODO(yoz): this is not incognito-safe!
 | 
| +    ExtensionProcessManager* manager = system_->process_manager();
 | 
|      ExtensionHost* host = manager->GetBackgroundHostForExtension(extension_id);
 | 
|      if (host && DevToolsAgentHostRegistry::HasDevToolsAgentHost(
 | 
|              host->render_view_host())) {
 | 
| @@ -990,7 +994,7 @@ void ExtensionService::NotifyExtensionLoaded(const Extension* extension) {
 | 
|    // that the request context doesn't yet know about. The profile is responsible
 | 
|    // for ensuring its URLRequestContexts appropriately discover the loaded
 | 
|    // extension.
 | 
| -  profile_->RegisterExtensionWithRequestContexts(extension);
 | 
| +  system_->RegisterExtensionWithRequestContexts(extension);
 | 
|  
 | 
|    // Tell renderers about the new extension, unless it's a theme (renderers
 | 
|    // don't need to know about themes).
 | 
| @@ -1137,7 +1141,7 @@ void ExtensionService::NotifyExtensionUnloaded(
 | 
|        host->Send(new ExtensionMsg_Unloaded(extension->id()));
 | 
|    }
 | 
|  
 | 
| -  profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
 | 
| +  system_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
 | 
|    profile_->GetExtensionSpecialStoragePolicy()->
 | 
|        RevokeRightsForExtension(extension);
 | 
|  
 | 
| @@ -1880,7 +1884,7 @@ void ExtensionService::UnloadExtension(
 | 
|    if (!extension) {
 | 
|      // In case the extension may have crashed/uninstalled. Allow the profile to
 | 
|      // clean up its RequestContexts.
 | 
| -    profile_->UnregisterExtensionWithRequestContexts(extension_id, reason);
 | 
| +    system_->UnregisterExtensionWithRequestContexts(extension_id, reason);
 | 
|      return;
 | 
|    }
 | 
|  
 | 
| @@ -1905,7 +1909,7 @@ if (disabled_extensions_.Contains(extension->id())) {
 | 
|      // Make sure the profile cleans up its RequestContexts when an already
 | 
|      // disabled extension is unloaded (since they are also tracking the disabled
 | 
|      // extensions).
 | 
| -    profile_->UnregisterExtensionWithRequestContexts(extension_id, reason);
 | 
| +    system_->UnregisterExtensionWithRequestContexts(extension_id, reason);
 | 
|      return;
 | 
|    }
 | 
|  
 | 
| @@ -2476,7 +2480,7 @@ void ExtensionService::Observe(int type,
 | 
|        BrowserThread::PostTask(
 | 
|            BrowserThread::IO, FROM_HERE,
 | 
|            base::Bind(&ExtensionInfoMap::UnregisterAllExtensionsInProcess,
 | 
| -                     profile_->GetExtensionInfoMap(),
 | 
| +                     system_->info_map(),
 | 
|                       process->GetID()));
 | 
|        break;
 | 
|      }
 | 
| 
 |