| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 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" | |
| 23 | |
| 24 namespace policy { | |
| 25 class WildcardLoginChecker; | |
| 26 } | |
| 27 | |
| 28 namespace chromeos { | |
| 29 | |
| 30 // This class implements chrome-specific elements of Login Performer. | |
| 31 | |
| 32 class ChromeLoginPerformer : public LoginPerformer { | |
| 33 public: | |
| 34 explicit ChromeLoginPerformer(Delegate* delegate); | |
| 35 virtual ~ChromeLoginPerformer(); | |
| 36 | |
| 37 protected: | |
| 38 virtual bool RunTrustedCheck(const base::Closure& callback) override; | |
| 39 void DidRunTrustedCheck(const base::Closure& callback); | |
| 40 virtual bool IsUserWhitelisted(const std::string& user_id, | |
| 41 bool* wildcard_match) override; | |
| 42 | |
| 43 virtual void RunOnlineWhitelistCheck( | |
| 44 const std::string& user_id, | |
| 45 bool wildcard_match, | |
| 46 const base::Closure& success_callback, | |
| 47 const base::Closure& failure_callback) override; | |
| 48 virtual bool AreSupervisedUsersAllowed() override; | |
| 49 | |
| 50 virtual bool UseExtendedAuthenticatorForSupervisedUser( | |
| 51 const UserContext& user_context) override; | |
| 52 | |
| 53 virtual UserContext TransformSupervisedKey( | |
| 54 const UserContext& context) override; | |
| 55 | |
| 56 virtual void SetupSupervisedUserFlow(const std::string& user_id) override; | |
| 57 | |
| 58 virtual scoped_refptr<Authenticator> CreateAuthenticator() override; | |
| 59 virtual bool CheckPolicyForUser(const std::string& user_id) override; | |
| 60 virtual content::BrowserContext* GetSigninContext() override; | |
| 61 virtual net::URLRequestContextGetter* GetSigninRequestContext() override; | |
| 62 | |
| 63 private: | |
| 64 void OnlineWildcardLoginCheckCompleted( | |
| 65 const base::Closure& success_callback, | |
| 66 const base::Closure& failure_callback, | |
| 67 policy::WildcardLoginChecker::Result result); | |
| 68 | |
| 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_; | |
| 72 | |
| 73 DISALLOW_COPY_AND_ASSIGN(ChromeLoginPerformer); | |
| 74 }; | |
| 75 | |
| 76 } // namespace chromeos | |
| 77 | |
| 78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | |
| OLD | NEW |