| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class Authenticator : public base::RefCountedThreadSafe<Authenticator> { | 24 class Authenticator : public base::RefCountedThreadSafe<Authenticator> { |
| 25 public: | 25 public: |
| 26 // A domain which requires special-case parsing in canonicalization. | 26 // A domain which requires special-case parsing in canonicalization. |
| 27 static const char kSpecialCaseDomain[]; | 27 static const char kSpecialCaseDomain[]; |
| 28 | 28 |
| 29 explicit Authenticator(LoginStatusConsumer* consumer); | 29 explicit Authenticator(LoginStatusConsumer* consumer); |
| 30 virtual ~Authenticator(); | 30 virtual ~Authenticator(); |
| 31 | 31 |
| 32 // Given externally authenticated |username| and |password|, this method | 32 // Given externally authenticated |username| and |password|, this method |
| 33 // attempts to complete authentication process. | 33 // attempts to complete authentication process. |
| 34 // Returns true if the attempt gets sent successfully and false if not. | 34 virtual void CompleteLogin(Profile* profile, |
| 35 virtual bool CompleteLogin(Profile* profile, | |
| 36 const std::string& username, | 35 const std::string& username, |
| 37 const std::string& password) = 0; | 36 const std::string& password) = 0; |
| 38 | 37 |
| 39 // Given a |username| and |password|, this method attempts to authenticate | 38 // Given a |username| and |password|, this method attempts to authenticate |
| 40 // to login. | 39 // to login. |
| 41 // Optionally |login_token| and |login_captcha| could be provided. | 40 // Optionally |login_token| and |login_captcha| could be provided. |
| 42 // Returns true if we kick off the attempt successfully and false if we can't. | |
| 43 // Must be called on the UI thread. | 41 // Must be called on the UI thread. |
| 44 virtual bool AuthenticateToLogin(Profile* profile, | 42 virtual void AuthenticateToLogin(Profile* profile, |
| 45 const std::string& username, | 43 const std::string& username, |
| 46 const std::string& password, | 44 const std::string& password, |
| 47 const std::string& login_token, | 45 const std::string& login_token, |
| 48 const std::string& login_captcha) = 0; | 46 const std::string& login_captcha) = 0; |
| 49 | 47 |
| 50 // Given a |username| and |password|, this method attempts to | 48 // Given a |username| and |password|, this method attempts to |
| 51 // authenticate to unlock the computer. | 49 // authenticate to unlock the computer. |
| 52 // Returns true if we kick off the attempt successfully and false if | 50 // Returns true if we kick off the attempt successfully and false if |
| 53 // we can't. Must be called on the UI thread. | 51 // we can't. Must be called on the UI thread. |
| 54 virtual bool AuthenticateToUnlock(const std::string& username, | 52 virtual bool AuthenticateToUnlock(const std::string& username, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 LoginStatusConsumer* consumer_; | 117 LoginStatusConsumer* consumer_; |
| 120 Profile* authentication_profile_; | 118 Profile* authentication_profile_; |
| 121 | 119 |
| 122 private: | 120 private: |
| 123 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 121 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 } // namespace chromeos | 124 } // namespace chromeos |
| 127 | 125 |
| 128 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
| OLD | NEW |