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