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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/extensions/install_limiter_factory.h"
7 #include "chrome/browser/chromeos/extensions/install_limiter.h"
8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
12 namespace extensions
{
15 InstallLimiter
* InstallLimiterFactory::GetForProfile(Profile
* profile
) {
16 return static_cast<InstallLimiter
*>(
17 GetInstance()->GetServiceForBrowserContext(profile
, true));
21 InstallLimiterFactory
* InstallLimiterFactory::GetInstance() {
22 return Singleton
<InstallLimiterFactory
>::get();
25 InstallLimiterFactory::InstallLimiterFactory()
26 : BrowserContextKeyedServiceFactory(
28 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(ExtensionSystemFactory::GetInstance());
32 InstallLimiterFactory::~InstallLimiterFactory() {
35 BrowserContextKeyedService
* InstallLimiterFactory::BuildServiceInstanceFor(
36 content::BrowserContext
* profile
) const {
37 return new InstallLimiter();
40 } // namespace extensions