diff options
Diffstat (limited to 'chromium/chrome/browser/signin/about_signin_internals_factory.cc')
-rw-r--r-- | chromium/chrome/browser/signin/about_signin_internals_factory.cc | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/chromium/chrome/browser/signin/about_signin_internals_factory.cc b/chromium/chrome/browser/signin/about_signin_internals_factory.cc new file mode 100644 index 00000000000..7e62dc93ebf --- /dev/null +++ b/chromium/chrome/browser/signin/about_signin_internals_factory.cc @@ -0,0 +1,58 @@ +// Copyright (c) 2012 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/about_signin_internals_factory.h" + +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/signin/account_consistency_mode_manager.h" +#include "chrome/browser/signin/account_consistency_mode_manager_factory.h" +#include "chrome/browser/signin/account_reconcilor_factory.h" +#include "chrome/browser/signin/chrome_signin_client_factory.h" +#include "chrome/browser/signin/identity_manager_factory.h" +#include "chrome/browser/signin/signin_error_controller_factory.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/pref_registry/pref_registry_syncable.h" +#include "components/signin/core/browser/about_signin_internals.h" + +AboutSigninInternalsFactory::AboutSigninInternalsFactory() + : BrowserContextKeyedServiceFactory( + "AboutSigninInternals", + BrowserContextDependencyManager::GetInstance()) { + DependsOn(ChromeSigninClientFactory::GetInstance()); + DependsOn(SigninErrorControllerFactory::GetInstance()); + DependsOn(AccountReconcilorFactory::GetInstance()); + DependsOn(IdentityManagerFactory::GetInstance()); + DependsOn(AccountConsistencyModeManagerFactory::GetInstance()); +} + +AboutSigninInternalsFactory::~AboutSigninInternalsFactory() {} + +// static +AboutSigninInternals* AboutSigninInternalsFactory::GetForProfile( + Profile* profile) { + return static_cast<AboutSigninInternals*>( + GetInstance()->GetServiceForBrowserContext(profile, true)); +} + +// static +AboutSigninInternalsFactory* AboutSigninInternalsFactory::GetInstance() { + return base::Singleton<AboutSigninInternalsFactory>::get(); +} + +void AboutSigninInternalsFactory::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* user_prefs) { + AboutSigninInternals::RegisterPrefs(user_prefs); +} + +KeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = Profile::FromBrowserContext(context); + AboutSigninInternals* service = new AboutSigninInternals( + IdentityManagerFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile), + AccountConsistencyModeManager::GetMethodForProfile(profile), + ChromeSigninClientFactory::GetForProfile(profile), + AccountReconcilorFactory::GetForProfile(profile)); + return service; +} |