Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / users_private / users_private_delegate_factory.cc
blob0fe48db975f2401a0a5f3e734b5d34ac7587fd67
1 // Copyright 2015 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/users_private/users_private_delegate_factory.h"
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/extensions/users_private/users_private_delegate.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "extensions/browser/extension_system_provider.h"
13 namespace extensions {
15 using content::BrowserContext;
17 // static
18 UsersPrivateDelegate* UsersPrivateDelegateFactory::GetForBrowserContext(
19 BrowserContext* browser_context) {
20 return static_cast<UsersPrivateDelegate*>(
21 GetInstance()->GetServiceForBrowserContext(browser_context, true));
24 // static
25 UsersPrivateDelegateFactory* UsersPrivateDelegateFactory::GetInstance() {
26 return Singleton<UsersPrivateDelegateFactory>::get();
29 UsersPrivateDelegateFactory::UsersPrivateDelegateFactory()
30 : BrowserContextKeyedServiceFactory(
31 "UsersPrivateDelegate",
32 BrowserContextDependencyManager::GetInstance()) {
35 UsersPrivateDelegateFactory::~UsersPrivateDelegateFactory() {
38 KeyedService* UsersPrivateDelegateFactory::BuildServiceInstanceFor(
39 content::BrowserContext* profile) const {
40 return new UsersPrivateDelegate(static_cast<Profile*>(profile));
43 } // namespace extensions