Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h

Issue 143463009: Add policy that forces SAML users to log in online periodically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Speculative fix for PolicyPrefIndicatorTest.CheckPolicyIndicators/3. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h
diff --git a/chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h b/chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3533c86c44bdde755003e48bb4d5dfbd26cefd0
--- /dev/null
+++ b/chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h
@@ -0,0 +1,53 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/singleton.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
+
+class Profile;
+
+namespace base {
+class Clock;
+}
+
+namespace chromeos {
+
+class SAMLOfflineSigninLimiter;
+
+// Singleton that owns all SAMLOfflineSigninLimiters and associates them with
+// Profiles.
+class SAMLOfflineSigninLimiterFactory
+ : public BrowserContextKeyedServiceFactory {
+ public:
+ static SAMLOfflineSigninLimiterFactory* GetInstance();
+
+ static SAMLOfflineSigninLimiter* GetForProfile(Profile* profile);
+
+ // |clock| will be passed to all SAMLOfflineSigninLimiters. Ensure that their
+ // Shutdown() methods have been called before destroying |clock|.
+ static void SetClockForTesting(base::Clock* clock);
+
+ private:
+ friend struct DefaultSingletonTraits<SAMLOfflineSigninLimiterFactory>;
+
+ SAMLOfflineSigninLimiterFactory();
+ virtual ~SAMLOfflineSigninLimiterFactory();
+
+ // BrowserContextKeyedServiceFactory:
+ virtual BrowserContextKeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const OVERRIDE;
+
+ static base::Clock* clock_for_testing_;
+
+ DISALLOW_COPY_AND_ASSIGN(SAMLOfflineSigninLimiterFactory);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SAML_SAML_OFFLINE_SIGNIN_LIMITER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698