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