| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/extensions/install_limiter_factory.h" | 5 #include "chrome/browser/chromeos/extensions/install_limiter_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/extensions/install_limiter.h" | 7 #include "chrome/browser/chromeos/extensions/install_limiter.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 #include "extensions/browser/extension_system_provider.h" | 10 #include "extensions/browser/extension_system_provider.h" |
| 11 #include "extensions/browser/extensions_browser_client.h" | 11 #include "extensions/browser/extensions_browser_client.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 InstallLimiter* InstallLimiterFactory::GetForProfile(Profile* profile) { | 16 InstallLimiter* InstallLimiterFactory::GetForProfile(Profile* profile) { |
| 17 return static_cast<InstallLimiter*>( | 17 return static_cast<InstallLimiter*>( |
| 18 GetInstance()->GetServiceForBrowserContext(profile, true)); | 18 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 InstallLimiterFactory* InstallLimiterFactory::GetInstance() { | 22 InstallLimiterFactory* InstallLimiterFactory::GetInstance() { |
| 23 return Singleton<InstallLimiterFactory>::get(); | 23 return base::Singleton<InstallLimiterFactory>::get(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 InstallLimiterFactory::InstallLimiterFactory() | 26 InstallLimiterFactory::InstallLimiterFactory() |
| 27 : BrowserContextKeyedServiceFactory( | 27 : BrowserContextKeyedServiceFactory( |
| 28 "InstallLimiter", | 28 "InstallLimiter", |
| 29 BrowserContextDependencyManager::GetInstance()) { | 29 BrowserContextDependencyManager::GetInstance()) { |
| 30 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 30 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 InstallLimiterFactory::~InstallLimiterFactory() { | 33 InstallLimiterFactory::~InstallLimiterFactory() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 KeyedService* InstallLimiterFactory::BuildServiceInstanceFor( | 36 KeyedService* InstallLimiterFactory::BuildServiceInstanceFor( |
| 37 content::BrowserContext* profile) const { | 37 content::BrowserContext* profile) const { |
| 38 return new InstallLimiter(); | 38 return new InstallLimiter(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace extensions | 41 } // namespace extensions |
| OLD | NEW |