| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_system_factory.h" | 5 #include "chrome/browser/extensions/extension_system_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_prefs.h" | 7 #include "chrome/browser/extensions/extension_prefs.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 10 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 11 #include "chrome/browser/profiles/incognito_helpers.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_dependency_manager.h" | 13 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 13 #include "chrome/browser/themes/theme_service_factory.h" | 14 #include "chrome/browser/themes/theme_service_factory.h" |
| 14 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 15 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 15 | 16 |
| 16 namespace extensions { | 17 namespace extensions { |
| 17 | 18 |
| 18 // ExtensionSystemSharedFactory | 19 // ExtensionSystemSharedFactory |
| 19 | 20 |
| 20 // static | 21 // static |
| (...skipping 20 matching lines...) Expand all Loading... |
| 41 } | 42 } |
| 42 | 43 |
| 43 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 44 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( | 47 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
| 47 content::BrowserContext* profile) const { | 48 content::BrowserContext* profile) const { |
| 48 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(profile)); | 49 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(profile)); |
| 49 } | 50 } |
| 50 | 51 |
| 51 bool ExtensionSystemSharedFactory::ServiceRedirectedInIncognito() const { | 52 content::BrowserContext* ExtensionSystemSharedFactory::GetBrowserContextToUse( |
| 52 return true; | 53 content::BrowserContext* context) const { |
| 54 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 53 } | 55 } |
| 54 | 56 |
| 55 // ExtensionSystemFactory | 57 // ExtensionSystemFactory |
| 56 | 58 |
| 57 // static | 59 // static |
| 58 ExtensionSystem* ExtensionSystemFactory::GetForProfile(Profile* profile) { | 60 ExtensionSystem* ExtensionSystemFactory::GetForProfile(Profile* profile) { |
| 59 return static_cast<ExtensionSystem*>( | 61 return static_cast<ExtensionSystem*>( |
| 60 GetInstance()->GetServiceForProfile(profile, true)); | 62 GetInstance()->GetServiceForProfile(profile, true)); |
| 61 } | 63 } |
| 62 | 64 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 } | 75 } |
| 74 | 76 |
| 75 ExtensionSystemFactory::~ExtensionSystemFactory() { | 77 ExtensionSystemFactory::~ExtensionSystemFactory() { |
| 76 } | 78 } |
| 77 | 79 |
| 78 ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( | 80 ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( |
| 79 content::BrowserContext* profile) const { | 81 content::BrowserContext* profile) const { |
| 80 return new ExtensionSystemImpl(static_cast<Profile*>(profile)); | 82 return new ExtensionSystemImpl(static_cast<Profile*>(profile)); |
| 81 } | 83 } |
| 82 | 84 |
| 83 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() const { | 85 content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( |
| 84 return true; | 86 content::BrowserContext* context) const { |
| 87 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 85 } | 88 } |
| 86 | 89 |
| 87 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() const { | 90 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() const { |
| 88 return true; | 91 return true; |
| 89 } | 92 } |
| 90 | 93 |
| 91 } // namespace extensions | 94 } // namespace extensions |
| OLD | NEW |