Chromium Code Reviews| Index: chrome/browser/signin/chrome_proximity_auth_client_factory.cc |
| diff --git a/chrome/browser/signin/chrome_proximity_auth_client_factory.cc b/chrome/browser/signin/chrome_proximity_auth_client_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0721acdf212e3957ea0b990bc38669a0fdc52663 |
| --- /dev/null |
| +++ b/chrome/browser/signin/chrome_proximity_auth_client_factory.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/signin/chrome_proximity_auth_client_factory.h" |
| + |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/signin/chrome_proximity_auth_client.h" |
| +#include "components/keyed_service/content/browser_context_dependency_manager.h" |
| + |
| +// static |
| +ChromeProximityAuthClientFactory* |
| +ChromeProximityAuthClientFactory::GetInstance() { |
| + return Singleton<ChromeProximityAuthClientFactory>::get(); |
| +} |
| + |
| +// static |
| +ChromeProximityAuthClient* ChromeProximityAuthClientFactory::GetForProfile( |
| + Profile* profile) { |
| + return static_cast<ChromeProximityAuthClient*>( |
| + GetInstance()->GetServiceForBrowserContext(profile, true)); |
| +} |
| + |
| +ChromeProximityAuthClientFactory::ChromeProximityAuthClientFactory() |
| + : BrowserContextKeyedServiceFactory( |
| + "ChromeProximityAuthClient", |
| + BrowserContextDependencyManager::GetInstance()) { |
| +} |
|
Mike Lerman
2015/06/26 13:09:51
DependsOn(SigninManagerFactory)?
Ilya Sherman
2015/06/27 08:18:00
Acknowledged. I think it actually wouldn't have b
|
| + |
| +ChromeProximityAuthClientFactory::~ChromeProximityAuthClientFactory() { |
| +} |
| + |
| +KeyedService* ChromeProximityAuthClientFactory::BuildServiceInstanceFor( |
| + content::BrowserContext* context) const { |
| + return new ChromeProximityAuthClient(Profile::FromBrowserContext(context)); |
| +} |