| 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 CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ |
| 6 #define CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ | 6 #define CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class AuthAttemptState; | 28 class AuthAttemptState; |
| 29 class OnlineAttempt; | 29 class OnlineAttempt; |
| 30 class UserContext; | 30 class UserContext; |
| 31 | 31 |
| 32 // Helper class which hosts OnlineAttempt for online credentials checking. | 32 // Helper class which hosts OnlineAttempt for online credentials checking. |
| 33 class CHROMEOS_EXPORT OnlineAttemptHost : public AuthAttemptStateResolver { | 33 class CHROMEOS_EXPORT OnlineAttemptHost : public AuthAttemptStateResolver { |
| 34 public: | 34 public: |
| 35 class Delegate { | 35 class Delegate { |
| 36 public: | 36 public: |
| 37 // Called after user_context were checked online. | 37 // Called after user_context were checked online. |
| 38 virtual void OnChecked(const std::string& username, bool success) = 0; | 38 virtual void OnChecked(const user_manager::UserID& user_id, bool success) =
0; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 explicit OnlineAttemptHost(Delegate* delegate); | 41 explicit OnlineAttemptHost(Delegate* delegate); |
| 42 ~OnlineAttemptHost() override; | 42 ~OnlineAttemptHost() override; |
| 43 | 43 |
| 44 // Performs an online check of the credentials in |request_context| and | 44 // Performs an online check of the credentials in |request_context| and |
| 45 // invokes | 45 // invokes |
| 46 // the delegate's OnChecked() with the result. Note that only one check can be | 46 // the delegate's OnChecked() with the result. Note that only one check can be |
| 47 // in progress at any given time. If this method is invoked with a different | 47 // in progress at any given time. If this method is invoked with a different |
| 48 // |user_context| than a check currently in progress, the current check will | 48 // |user_context| than a check currently in progress, the current check will |
| (...skipping 18 matching lines...) Expand all Loading... |
| 67 scoped_ptr<OnlineAttempt> online_attempt_; | 67 scoped_ptr<OnlineAttempt> online_attempt_; |
| 68 scoped_ptr<AuthAttemptState> state_; | 68 scoped_ptr<AuthAttemptState> state_; |
| 69 base::WeakPtrFactory<OnlineAttemptHost> weak_ptr_factory_; | 69 base::WeakPtrFactory<OnlineAttemptHost> weak_ptr_factory_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(OnlineAttemptHost); | 71 DISALLOW_COPY_AND_ASSIGN(OnlineAttemptHost); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace chromeos | 74 } // namespace chromeos |
| 75 | 75 |
| 76 #endif // CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ | 76 #endif // CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_HOST_H_ |
| OLD | NEW |