| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LOGIN_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_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/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/authenticator.h" | 12 #include "chrome/browser/chromeos/login/authenticator.h" |
| 13 #include "chrome/browser/chromeos/login/login_status_consumer.h" | 13 #include "chrome/browser/chromeos/login/login_status_consumer.h" |
| 14 #include "chrome/browser/chromeos/login/online_attempt_host.h" | 14 #include "chrome/browser/chromeos/login/online_attempt_host.h" |
| 15 #include "chrome/browser/chromeos/login/user.h" | 15 #include "chrome/browser/chromeos/login/user.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "google_apis/gaia/google_service_auth_error.h" | 19 #include "google_apis/gaia/google_service_auth_error.h" |
| 20 | 20 |
| 21 namespace policy { |
| 22 class WildcardLoginChecker; |
| 23 } |
| 24 |
| 21 namespace chromeos { | 25 namespace chromeos { |
| 22 | 26 |
| 23 // This class encapsulates sign in operations. | 27 // This class encapsulates sign in operations. |
| 24 // Sign in is performed in a way that offline auth is executed first. | 28 // Sign in is performed in a way that offline auth is executed first. |
| 25 // Once offline auth is OK - user homedir is mounted, UI is launched. | 29 // Once offline auth is OK - user homedir is mounted, UI is launched. |
| 26 // At this point LoginPerformer |delegate_| is destroyed and it releases | 30 // At this point LoginPerformer |delegate_| is destroyed and it releases |
| 27 // LP instance ownership. LP waits for online login result. | 31 // LP instance ownership. LP waits for online login result. |
| 28 // If auth is succeeded, cookie fetcher is executed, LP instance deletes itself. | 32 // If auth is succeeded, cookie fetcher is executed, LP instance deletes itself. |
| 29 // | 33 // |
| 30 // If |delegate_| is not NULL it will handle error messages, password input. | 34 // If |delegate_| is not NULL it will handle error messages, password input. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Implements OnlineAttemptHost::Delegate. | 114 // Implements OnlineAttemptHost::Delegate. |
| 111 virtual void OnChecked(const std::string& username, bool success) OVERRIDE; | 115 virtual void OnChecked(const std::string& username, bool success) OVERRIDE; |
| 112 | 116 |
| 113 private: | 117 private: |
| 114 // Starts login completion of externally authenticated user. | 118 // Starts login completion of externally authenticated user. |
| 115 void StartLoginCompletion(); | 119 void StartLoginCompletion(); |
| 116 | 120 |
| 117 // Starts authentication. | 121 // Starts authentication. |
| 118 void StartAuthentication(); | 122 void StartAuthentication(); |
| 119 | 123 |
| 124 // Completion callback for the online wildcard login check for enterprise |
| 125 // devices. Continues the login process or signals whitelist check failure |
| 126 // depending on the value of |result|. |
| 127 void OnlineWildcardLoginCheckCompleted(bool result); |
| 128 |
| 120 // Used for logging in. | 129 // Used for logging in. |
| 121 scoped_refptr<Authenticator> authenticator_; | 130 scoped_refptr<Authenticator> authenticator_; |
| 122 | 131 |
| 123 // Used to make auxiliary online check. | 132 // Used to make auxiliary online check. |
| 124 OnlineAttemptHost online_attempt_host_; | 133 OnlineAttemptHost online_attempt_host_; |
| 125 | 134 |
| 126 // Represents last login failure that was encountered when communicating to | 135 // Represents last login failure that was encountered when communicating to |
| 127 // sign-in server. LoginFailure.LoginFailureNone() by default. | 136 // sign-in server. LoginFailure.LoginFailureNone() by default. |
| 128 LoginFailure last_login_failure_; | 137 LoginFailure last_login_failure_; |
| 129 | 138 |
| 130 // User credentials for the current login attempt. | 139 // User credentials for the current login attempt. |
| 131 UserContext user_context_; | 140 UserContext user_context_; |
| 132 | 141 |
| 133 // Notifications receiver. | 142 // Notifications receiver. |
| 134 Delegate* delegate_; | 143 Delegate* delegate_; |
| 135 | 144 |
| 136 // True if password change has been detected. | 145 // True if password change has been detected. |
| 137 // Once correct password is entered homedir migration is executed. | 146 // Once correct password is entered homedir migration is executed. |
| 138 bool password_changed_; | 147 bool password_changed_; |
| 139 int password_changed_callback_count_; | 148 int password_changed_callback_count_; |
| 140 | 149 |
| 141 // Authorization mode type. | 150 // Authorization mode type. |
| 142 AuthorizationMode auth_mode_; | 151 AuthorizationMode auth_mode_; |
| 143 | 152 |
| 153 // Used to verify logins that matched wildcard on the login whitelist. |
| 154 scoped_ptr<policy::WildcardLoginChecker> wildcard_login_checker_; |
| 155 |
| 144 base::WeakPtrFactory<LoginPerformer> weak_factory_; | 156 base::WeakPtrFactory<LoginPerformer> weak_factory_; |
| 145 | 157 |
| 146 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); | 158 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); |
| 147 }; | 159 }; |
| 148 | 160 |
| 149 } // namespace chromeos | 161 } // namespace chromeos |
| 150 | 162 |
| 151 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ | 163 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ |
| OLD | NEW |