OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "chrome/browser/chromeos/login/login_status_consumer.h" | 11 #include "chrome/browser/chromeos/login/login_status_consumer.h" |
12 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 12 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
13 | 13 |
14 class Profile; | 14 class Profile; |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 // An interface for objects that will authenticate a Chromium OS user. | 18 // An interface for objects that will authenticate a Chromium OS user. |
19 // When authentication successfully completes, will call | 19 // When authentication successfully completes, will call |
20 // consumer_->OnLoginSuccess() on the UI thread. | 20 // consumer_->OnLoginSuccess() on the UI thread. |
21 // On failure, will call consumer_->OnLoginFailure() on the UI thread. | 21 // On failure, will call consumer_->OnLoginFailure() on the UI thread. |
22 // On password change detected, will call | 22 // On password change detected, will call |
23 // consumer_->OnPasswordChangeDetected() on the UI thread. | 23 // consumer_->OnPasswordChangeDetected() on the UI thread. |
24 class Authenticator : public base::RefCountedThreadSafe<Authenticator> { | 24 class Authenticator : public base::RefCountedThreadSafe<Authenticator> { |
25 public: | 25 public: |
26 static const char kSpecialCase[]; | |
whywhat
2010/12/30 17:37:39
Could be more meaningful, i.e. kTolerantDomain. A
Chris Masone
2010/12/30 18:52:50
I went with kSpecialCaseDomain, and added a commen
| |
27 | |
26 explicit Authenticator(LoginStatusConsumer* consumer); | 28 explicit Authenticator(LoginStatusConsumer* consumer); |
27 virtual ~Authenticator(); | 29 virtual ~Authenticator(); |
28 | 30 |
29 // Given a |username| and |password|, this method attempts to authenticate | 31 // Given a |username| and |password|, this method attempts to authenticate |
30 // to login. | 32 // to login. |
31 // Optionally |login_token| and |login_captcha| could be provided. | 33 // Optionally |login_token| and |login_captcha| could be provided. |
32 // Returns true if we kick off the attempt successfully and false if we can't. | 34 // Returns true if we kick off the attempt successfully and false if we can't. |
33 // Must be called on the UI thread. | 35 // Must be called on the UI thread. |
34 virtual bool AuthenticateToLogin(Profile* profile, | 36 virtual bool AuthenticateToLogin(Profile* profile, |
35 const std::string& username, | 37 const std::string& username, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 protected: | 95 protected: |
94 LoginStatusConsumer* consumer_; | 96 LoginStatusConsumer* consumer_; |
95 | 97 |
96 private: | 98 private: |
97 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 99 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
98 }; | 100 }; |
99 | 101 |
100 } // namespace chromeos | 102 } // namespace chromeos |
101 | 103 |
102 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 104 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
OLD | NEW |