Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Side by Side Diff: chromeos/login/auth/authenticator.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/basictypes.h" 10 #include "base/basictypes.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 namespace content { 16 namespace content {
17 class BrowserContext; 17 class BrowserContext;
18 } 18 }
19 19
20 namespace user_manager {
21 class UserID;
22 }
23
20 namespace chromeos { 24 namespace chromeos {
21 25
22 class UserContext; 26 class UserContext;
23 27
24 // An interface for objects that will authenticate a Chromium OS user. 28 // An interface for objects that will authenticate a Chromium OS user.
25 // Callbacks will be called on the UI thread: 29 // Callbacks will be called on the UI thread:
26 // 1. On successful authentication, will call consumer_->OnAuthSuccess(). 30 // 1. On successful authentication, will call consumer_->OnAuthSuccess().
27 // 2. On failure, will call consumer_->OnAuthFailure(). 31 // 2. On failure, will call consumer_->OnAuthFailure().
28 // 3. On password change, will call consumer_->OnPasswordChangeDetected(). 32 // 3. On password change, will call consumer_->OnPasswordChangeDetected().
29 class CHROMEOS_EXPORT Authenticator 33 class CHROMEOS_EXPORT Authenticator
(...skipping 23 matching lines...) Expand all
53 // Initiates incognito ("browse without signing in") login. 57 // Initiates incognito ("browse without signing in") login.
54 virtual void LoginOffTheRecord() = 0; 58 virtual void LoginOffTheRecord() = 0;
55 59
56 // Initiates login into the public account identified by |user_context|. 60 // Initiates login into the public account identified by |user_context|.
57 virtual void LoginAsPublicSession(const UserContext& user_context) = 0; 61 virtual void LoginAsPublicSession(const UserContext& user_context) = 0;
58 62
59 // Initiates login into kiosk mode account identified by |app_user_id|. 63 // Initiates login into kiosk mode account identified by |app_user_id|.
60 // The |app_user_id| is a generated username for the account. 64 // The |app_user_id| is a generated username for the account.
61 // |use_guest_mount| specifies whether to force the session to use a 65 // |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. 66 // guest mount. If this is false, we use mount a public cryptohome.
63 virtual void LoginAsKioskAccount(const std::string& app_user_id, 67 virtual void LoginAsKioskAccount(const user_manager::UserID& app_user_id,
64 bool use_guest_mount) = 0; 68 bool use_guest_mount) = 0;
65 69
66 // Notifies caller that login was successful. Must be called on the UI thread. 70 // Notifies caller that login was successful. Must be called on the UI thread.
67 virtual void OnAuthSuccess() = 0; 71 virtual void OnAuthSuccess() = 0;
68 72
69 // Must be called on the UI thread. 73 // Must be called on the UI thread.
70 virtual void OnAuthFailure(const AuthFailure& error) = 0; 74 virtual void OnAuthFailure(const AuthFailure& error) = 0;
71 75
72 // Call these methods on the UI thread. 76 // Call these methods on the UI thread.
73 // If a password logs the user in online, but cannot be used to 77 // If a password logs the user in online, but cannot be used to
(...skipping 25 matching lines...) Expand all
99 103
100 private: 104 private:
101 friend class base::RefCountedThreadSafe<Authenticator>; 105 friend class base::RefCountedThreadSafe<Authenticator>;
102 106
103 DISALLOW_COPY_AND_ASSIGN(Authenticator); 107 DISALLOW_COPY_AND_ASSIGN(Authenticator);
104 }; 108 };
105 109
106 } // namespace chromeos 110 } // namespace chromeos
107 111
108 #endif // CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ 112 #endif // CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698