ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / chromeos / login / auth / chrome_login_performer.h
blobacc8485ea5354a9807b3fe5db2db04311bf2cd83
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_AUTH_CHROME_LOGIN_PERFORMER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/chromeos/policy/wildcard_login_checker.h"
14 #include "chromeos/login/auth/auth_status_consumer.h"
15 #include "chromeos/login/auth/authenticator.h"
16 #include "chromeos/login/auth/extended_authenticator.h"
17 #include "chromeos/login/auth/login_performer.h"
18 #include "chromeos/login/auth/online_attempt_host.h"
19 #include "chromeos/login/auth/user_context.h"
20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h"
22 #include "google_apis/gaia/google_service_auth_error.h"
24 namespace policy {
25 class WildcardLoginChecker;
28 namespace chromeos {
30 // This class implements chrome-specific elements of Login Performer.
32 class ChromeLoginPerformer : public LoginPerformer {
33 public:
34 explicit ChromeLoginPerformer(Delegate* delegate);
35 ~ChromeLoginPerformer() override;
37 protected:
38 bool RunTrustedCheck(const base::Closure& callback) override;
39 void DidRunTrustedCheck(const base::Closure& callback);
40 bool IsUserWhitelisted(const std::string& user_id,
41 bool* wildcard_match) override;
43 void RunOnlineWhitelistCheck(const std::string& user_id,
44 bool wildcard_match,
45 const base::Closure& success_callback,
46 const base::Closure& failure_callback) override;
47 bool AreSupervisedUsersAllowed() override;
49 bool UseExtendedAuthenticatorForSupervisedUser(
50 const UserContext& user_context) override;
52 UserContext TransformSupervisedKey(const UserContext& context) override;
54 void SetupSupervisedUserFlow(const std::string& user_id) override;
56 void SetupEasyUnlockUserFlow(const std::string& user_id) override;
58 scoped_refptr<Authenticator> CreateAuthenticator() override;
59 bool CheckPolicyForUser(const std::string& user_id) override;
60 content::BrowserContext* GetSigninContext() override;
61 net::URLRequestContextGetter* GetSigninRequestContext() override;
63 private:
64 void OnlineWildcardLoginCheckCompleted(
65 const base::Closure& success_callback,
66 const base::Closure& failure_callback,
67 policy::WildcardLoginChecker::Result result);
69 // Used to verify logins that matched wildcard on the login whitelist.
70 scoped_ptr<policy::WildcardLoginChecker> wildcard_login_checker_;
71 base::WeakPtrFactory<ChromeLoginPerformer> weak_factory_;
73 DISALLOW_COPY_AND_ASSIGN(ChromeLoginPerformer);
76 } // namespace chromeos
78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_