12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/singleton.h"
9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class AboutSigninInternals;
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Profile;
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Singleton that owns all AboutSigninInternals and associates them with
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Profiles.
1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)class AboutSigninInternalsFactory : public BrowserContextKeyedServiceFactory {
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Returns the instance of AboutSigninInternals associated with this profile,
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // creating one if none exists.
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static AboutSigninInternals* GetForProfile(Profile* profile);
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Returns an instance of the AboutSigninInternalsFactory singleton.
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static AboutSigninInternalsFactory* GetInstance();
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // Implementation of BrowserContextKeyedServiceFactory.
267dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  virtual void RegisterProfilePrefs(
27c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      user_prefs::PrefRegistrySyncable* registry) OVERRIDE;
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  friend struct DefaultSingletonTraits<AboutSigninInternalsFactory>;
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  AboutSigninInternalsFactory();
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~AboutSigninInternalsFactory();
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // BrowserContextKeyedServiceFactory
36a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual KeyedService* BuildServiceInstanceFor(
37e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch      content::BrowserContext* context) const OVERRIDE;
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_
41