| 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_AUTHENTICATOR_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ |
| 6 #define CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ | 6 #define CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/login/auth/auth_status_consumer.h" | 13 #include "chromeos/login/auth/auth_status_consumer.h" |
| 14 #include "google_apis/gaia/gaia_auth_consumer.h" | 14 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 15 | 15 |
| 16 class AccountId; |
| 17 |
| 16 namespace content { | 18 namespace content { |
| 17 class BrowserContext; | 19 class BrowserContext; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace chromeos { | 22 namespace chromeos { |
| 21 | 23 |
| 22 class UserContext; | 24 class UserContext; |
| 23 | 25 |
| 24 // An interface for objects that will authenticate a Chromium OS user. | 26 // An interface for objects that will authenticate a Chromium OS user. |
| 25 // Callbacks will be called on the UI thread: | 27 // Callbacks will be called on the UI thread: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 | 51 |
| 50 // Initiates supervised user login. | 52 // Initiates supervised user login. |
| 51 virtual void LoginAsSupervisedUser(const UserContext& user_context) = 0; | 53 virtual void LoginAsSupervisedUser(const UserContext& user_context) = 0; |
| 52 | 54 |
| 53 // Initiates incognito ("browse without signing in") login. | 55 // Initiates incognito ("browse without signing in") login. |
| 54 virtual void LoginOffTheRecord() = 0; | 56 virtual void LoginOffTheRecord() = 0; |
| 55 | 57 |
| 56 // Initiates login into the public account identified by |user_context|. | 58 // Initiates login into the public account identified by |user_context|. |
| 57 virtual void LoginAsPublicSession(const UserContext& user_context) = 0; | 59 virtual void LoginAsPublicSession(const UserContext& user_context) = 0; |
| 58 | 60 |
| 59 // Initiates login into kiosk mode account identified by |app_user_id|. | 61 // Initiates login into kiosk mode account identified by |app_account_id|. |
| 60 // The |app_user_id| is a generated username for the account. | 62 // The |app_account_id| is a generated account id for the account. |
| 61 // |use_guest_mount| specifies whether to force the session to use a | 63 // |use_guest_mount| specifies whether to force the session to use a |
| 62 // guest mount. If this is false, we use mount a public cryptohome. | 64 // guest mount. If this is false, we use mount a public cryptohome. |
| 63 virtual void LoginAsKioskAccount(const std::string& app_user_id, | 65 virtual void LoginAsKioskAccount(const AccountId& app_account_id, |
| 64 bool use_guest_mount) = 0; | 66 bool use_guest_mount) = 0; |
| 65 | 67 |
| 66 // Notifies caller that login was successful. Must be called on the UI thread. | 68 // Notifies caller that login was successful. Must be called on the UI thread. |
| 67 virtual void OnAuthSuccess() = 0; | 69 virtual void OnAuthSuccess() = 0; |
| 68 | 70 |
| 69 // Must be called on the UI thread. | 71 // Must be called on the UI thread. |
| 70 virtual void OnAuthFailure(const AuthFailure& error) = 0; | 72 virtual void OnAuthFailure(const AuthFailure& error) = 0; |
| 71 | 73 |
| 72 // Call these methods on the UI thread. | 74 // Call these methods on the UI thread. |
| 73 // If a password logs the user in online, but cannot be used to | 75 // If a password logs the user in online, but cannot be used to |
| (...skipping 25 matching lines...) Expand all Loading... |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 friend class base::RefCountedThreadSafe<Authenticator>; | 103 friend class base::RefCountedThreadSafe<Authenticator>; |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 105 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace chromeos | 108 } // namespace chromeos |
| 107 | 109 |
| 108 #endif // CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ | 110 #endif // CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ |
| OLD | NEW |