| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/chromeos/policy/wildcard_login_checker.h" | 13 #include "chrome/browser/chromeos/policy/wildcard_login_checker.h" |
| 14 #include "chromeos/login/auth/auth_status_consumer.h" | 14 #include "chromeos/login/auth/auth_status_consumer.h" |
| 15 #include "chromeos/login/auth/authenticator.h" | 15 #include "chromeos/login/auth/authenticator.h" |
| 16 #include "chromeos/login/auth/extended_authenticator.h" | 16 #include "chromeos/login/auth/extended_authenticator.h" |
| 17 #include "chromeos/login/auth/login_performer.h" | 17 #include "chromeos/login/auth/login_performer.h" |
| 18 #include "chromeos/login/auth/user_context.h" | 18 #include "chromeos/login/auth/user_context.h" |
| 19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 21 #include "google_apis/gaia/google_service_auth_error.h" | 21 #include "google_apis/gaia/google_service_auth_error.h" |
| 22 | 22 |
| 23 class AccountId; |
| 24 |
| 23 namespace policy { | 25 namespace policy { |
| 24 class WildcardLoginChecker; | 26 class WildcardLoginChecker; |
| 25 } | 27 } |
| 26 | 28 |
| 27 namespace chromeos { | 29 namespace chromeos { |
| 28 | 30 |
| 29 // This class implements chrome-specific elements of Login Performer. | 31 // This class implements chrome-specific elements of Login Performer. |
| 30 | 32 |
| 31 class ChromeLoginPerformer : public LoginPerformer { | 33 class ChromeLoginPerformer : public LoginPerformer { |
| 32 public: | 34 public: |
| 33 explicit ChromeLoginPerformer(Delegate* delegate); | 35 explicit ChromeLoginPerformer(Delegate* delegate); |
| 34 ~ChromeLoginPerformer() override; | 36 ~ChromeLoginPerformer() override; |
| 35 | 37 |
| 36 bool IsUserWhitelisted(const std::string& user_id, | 38 bool IsUserWhitelisted(const AccountId& account_id, |
| 37 bool* wildcard_match) override; | 39 bool* wildcard_match) override; |
| 38 | 40 |
| 39 protected: | 41 protected: |
| 40 bool RunTrustedCheck(const base::Closure& callback) override; | 42 bool RunTrustedCheck(const base::Closure& callback) override; |
| 41 void DidRunTrustedCheck(const base::Closure& callback); | 43 void DidRunTrustedCheck(const base::Closure& callback); |
| 42 | 44 |
| 43 void RunOnlineWhitelistCheck(const std::string& user_id, | 45 void RunOnlineWhitelistCheck(const AccountId& account_id, |
| 44 bool wildcard_match, | 46 bool wildcard_match, |
| 45 const std::string& refresh_token, | 47 const std::string& refresh_token, |
| 46 const base::Closure& success_callback, | 48 const base::Closure& success_callback, |
| 47 const base::Closure& failure_callback) override; | 49 const base::Closure& failure_callback) override; |
| 48 bool AreSupervisedUsersAllowed() override; | 50 bool AreSupervisedUsersAllowed() override; |
| 49 | 51 |
| 50 bool UseExtendedAuthenticatorForSupervisedUser( | 52 bool UseExtendedAuthenticatorForSupervisedUser( |
| 51 const UserContext& user_context) override; | 53 const UserContext& user_context) override; |
| 52 | 54 |
| 53 UserContext TransformSupervisedKey(const UserContext& context) override; | 55 UserContext TransformSupervisedKey(const UserContext& context) override; |
| 54 | 56 |
| 55 void SetupSupervisedUserFlow(const std::string& user_id) override; | 57 void SetupSupervisedUserFlow(const AccountId& account_id) override; |
| 56 | 58 |
| 57 void SetupEasyUnlockUserFlow(const std::string& user_id) override; | 59 void SetupEasyUnlockUserFlow(const AccountId& account_id) override; |
| 58 | 60 |
| 59 scoped_refptr<Authenticator> CreateAuthenticator() override; | 61 scoped_refptr<Authenticator> CreateAuthenticator() override; |
| 60 bool CheckPolicyForUser(const std::string& user_id) override; | 62 bool CheckPolicyForUser(const AccountId& account_id) override; |
| 61 content::BrowserContext* GetSigninContext() override; | 63 content::BrowserContext* GetSigninContext() override; |
| 62 net::URLRequestContextGetter* GetSigninRequestContext() override; | 64 net::URLRequestContextGetter* GetSigninRequestContext() override; |
| 63 | 65 |
| 64 private: | 66 private: |
| 65 void OnlineWildcardLoginCheckCompleted( | 67 void OnlineWildcardLoginCheckCompleted( |
| 66 const base::Closure& success_callback, | 68 const base::Closure& success_callback, |
| 67 const base::Closure& failure_callback, | 69 const base::Closure& failure_callback, |
| 68 policy::WildcardLoginChecker::Result result); | 70 policy::WildcardLoginChecker::Result result); |
| 69 | 71 |
| 70 // Used to verify logins that matched wildcard on the login whitelist. | 72 // Used to verify logins that matched wildcard on the login whitelist. |
| 71 scoped_ptr<policy::WildcardLoginChecker> wildcard_login_checker_; | 73 scoped_ptr<policy::WildcardLoginChecker> wildcard_login_checker_; |
| 72 base::WeakPtrFactory<ChromeLoginPerformer> weak_factory_; | 74 base::WeakPtrFactory<ChromeLoginPerformer> weak_factory_; |
| 73 | 75 |
| 74 DISALLOW_COPY_AND_ASSIGN(ChromeLoginPerformer); | 76 DISALLOW_COPY_AND_ASSIGN(ChromeLoginPerformer); |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace chromeos | 79 } // namespace chromeos |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_ |
| OLD | NEW |