1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/singleton.h"
11 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
21 class SAMLOfflineSigninLimiter
;
23 // Singleton that owns all SAMLOfflineSigninLimiters and associates them with
25 class SAMLOfflineSigninLimiterFactory
26 : public BrowserContextKeyedServiceFactory
{
28 static SAMLOfflineSigninLimiterFactory
* GetInstance();
30 static SAMLOfflineSigninLimiter
* GetForProfile(Profile
* profile
);
32 // |clock| will be passed to all SAMLOfflineSigninLimiters. Ensure that their
33 // Shutdown() methods have been called before destroying |clock|.
34 static void SetClockForTesting(base::Clock
* clock
);
37 friend struct DefaultSingletonTraits
<SAMLOfflineSigninLimiterFactory
>;
39 SAMLOfflineSigninLimiterFactory();
40 ~SAMLOfflineSigninLimiterFactory() override
;
42 // BrowserContextKeyedServiceFactory:
43 KeyedService
* BuildServiceInstanceFor(
44 content::BrowserContext
* context
) const override
;
46 static base::Clock
* clock_for_testing_
;
48 DISALLOW_COPY_AND_ASSIGN(SAMLOfflineSigninLimiterFactory
);
51 } // namespace chromeos
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_