ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / chromeos / login / saml / saml_offline_signin_limiter_factory.h
blobf81baaefe220644c92a421696847c1ff854a654c
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"
13 class Profile;
15 namespace base {
16 class Clock;
19 namespace chromeos {
21 class SAMLOfflineSigninLimiter;
23 // Singleton that owns all SAMLOfflineSigninLimiters and associates them with
24 // Profiles.
25 class SAMLOfflineSigninLimiterFactory
26 : public BrowserContextKeyedServiceFactory {
27 public:
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);
36 private:
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_