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 #ifndef IOS_CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_
6 #define IOS_CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
13 struct DefaultSingletonTraits
;
14 class AboutSigninInternals
;
18 class ChromeBrowserState
;
20 // Singleton that owns all AboutSigninInternals and associates them with browser
22 class AboutSigninInternalsFactory
: public BrowserStateKeyedServiceFactory
{
24 // Returns the instance of AboutSigninInternals associated with this browser
25 // state, creating one if none exists.
26 static AboutSigninInternals
* GetForBrowserState(
27 ios::ChromeBrowserState
* browser_state
);
29 // Returns an instance of the AboutSigninInternalsFactory singleton.
30 static AboutSigninInternalsFactory
* GetInstance();
33 friend struct DefaultSingletonTraits
<AboutSigninInternalsFactory
>;
35 AboutSigninInternalsFactory();
36 ~AboutSigninInternalsFactory() override
;
38 // BrowserStateKeyedServiceFactory:
39 scoped_ptr
<KeyedService
> BuildServiceInstanceFor(
40 web::BrowserState
* context
) const override
;
41 void RegisterBrowserStatePrefs(
42 user_prefs::PrefRegistrySyncable
* registry
) override
;
44 DISALLOW_COPY_AND_ASSIGN(AboutSigninInternalsFactory
);
49 #endif // IOS_CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_