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

Side by Side Diff: chrome/browser/chromeos/login/login_performer.h

Issue 10918027: Revert 154457 - Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // input & error messages display is dedicated to ScreenLocker instance. 47 // input & error messages display is dedicated to ScreenLocker instance.
48 // 48 //
49 // 2 things make LoginPerfrormer instance exist longer: 49 // 2 things make LoginPerfrormer instance exist longer:
50 // 1. ScreenLock active (pending correct new password input) 50 // 1. ScreenLock active (pending correct new password input)
51 // 2. Pending online auth request. 51 // 2. Pending online auth request.
52 // TODO(nkostylev): Cleanup ClientLogin related code, update class description. 52 // TODO(nkostylev): Cleanup ClientLogin related code, update class description.
53 class LoginPerformer : public LoginStatusConsumer, 53 class LoginPerformer : public LoginStatusConsumer,
54 public content::NotificationObserver, 54 public content::NotificationObserver,
55 public OnlineAttemptHost::Delegate { 55 public OnlineAttemptHost::Delegate {
56 public: 56 public:
57 typedef enum AuthorizationMode {
58 // Authorization performed internally by Chrome.
59 AUTH_MODE_INTERNAL,
60 // Authorization performed by an extension.
61 AUTH_MODE_EXTENSION
62 } AuthorizationMode;
63
64 // Delegate class to get notifications from the LoginPerformer. 57 // Delegate class to get notifications from the LoginPerformer.
65 class Delegate : public LoginStatusConsumer { 58 class Delegate : public LoginStatusConsumer {
66 public: 59 public:
67 virtual ~Delegate() {} 60 virtual ~Delegate() {}
68 virtual void WhiteListCheckFailed(const std::string& email) = 0; 61 virtual void WhiteListCheckFailed(const std::string& email) = 0;
69 virtual void PolicyLoadFailed() = 0; 62 virtual void PolicyLoadFailed() = 0;
70 virtual void OnOnlineChecked(const std::string& email, bool success) = 0; 63 virtual void OnOnlineChecked(const std::string& email, bool success) = 0;
71 }; 64 };
72 65
73 explicit LoginPerformer(Delegate* delegate); 66 explicit LoginPerformer(Delegate* delegate);
(...skipping 10 matching lines...) Expand all
84 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE; 77 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE;
85 virtual void OnDemoUserLoginSuccess() OVERRIDE; 78 virtual void OnDemoUserLoginSuccess() OVERRIDE;
86 virtual void OnLoginSuccess( 79 virtual void OnLoginSuccess(
87 const std::string& username, 80 const std::string& username,
88 const std::string& password, 81 const std::string& password,
89 bool pending_requests, 82 bool pending_requests,
90 bool using_oauth) OVERRIDE; 83 bool using_oauth) OVERRIDE;
91 virtual void OnOffTheRecordLoginSuccess() OVERRIDE; 84 virtual void OnOffTheRecordLoginSuccess() OVERRIDE;
92 virtual void OnPasswordChangeDetected() OVERRIDE; 85 virtual void OnPasswordChangeDetected() OVERRIDE;
93 86
94 // Performs a login for |username| and |password|. If auth_mode is 87 // Completes login process that has already been authenticated with
95 // AUTH_MODE_EXTENSION, there are no further auth checks, AUTH_MODE_INTERNAL 88 // provided |username| and |password|.
96 // will perform auth checks. 89 void CompleteLogin(const std::string& username, const std::string& password);
97 void PerformLogin(const std::string& username, 90
98 const std::string& password, 91 // Performs login with the |username| and |password| specified.
99 AuthorizationMode auth_mode); 92 void Login(const std::string& username, const std::string& password);
100 93
101 // Performs login for the demo user. 94 // Performs login for the demo user.
102 void LoginDemoUser(); 95 void LoginDemoUser();
103 96
104 // Performs actions to prepare Guest mode login. 97 // Performs actions to prepare Guest mode login.
105 void LoginOffTheRecord(); 98 void LoginOffTheRecord();
106 99
107 // Migrates cryptohome using |old_password| specified. 100 // Migrates cryptohome using |old_password| specified.
108 void RecoverEncryptedData(const std::string& old_password); 101 void RecoverEncryptedData(const std::string& old_password);
109 102
(...skipping 17 matching lines...) Expand all
127 // If user enters incorrect old password, same LoginPerformer instance will 120 // If user enters incorrect old password, same LoginPerformer instance will
128 // be called so callback count makes it possible to distinguish initial 121 // be called so callback count makes it possible to distinguish initial
129 // "password changed detected" event from further attempts to enter old 122 // "password changed detected" event from further attempts to enter old
130 // password for cryptohome migration (when > 1). 123 // password for cryptohome migration (when > 1).
131 int password_changed_callback_count() { 124 int password_changed_callback_count() {
132 return password_changed_callback_count_; 125 return password_changed_callback_count_;
133 } 126 }
134 127
135 void set_delegate(Delegate* delegate) { delegate_ = delegate; } 128 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
136 129
130 typedef enum AuthorizationMode {
131 // Authorization performed internally by Chrome.
132 AUTH_MODE_INTERNAL,
133 // Authorization performed by an extension.
134 AUTH_MODE_EXTENSION
135 } AuthorizationMode;
137 AuthorizationMode auth_mode() const { return auth_mode_; } 136 AuthorizationMode auth_mode() const { return auth_mode_; }
138 137
139 protected: 138 protected:
140 // Implements OnlineAttemptHost::Delegate. 139 // Implements OnlineAttemptHost::Delegate.
141 virtual void OnChecked(const std::string& username, bool success) OVERRIDE; 140 virtual void OnChecked(const std::string& username, bool success) OVERRIDE;
142 141
143 private: 142 private:
144 // content::NotificationObserver implementation: 143 // content::NotificationObserver implementation:
145 virtual void Observe(int type, 144 virtual void Observe(int type,
146 const content::NotificationSource& source, 145 const content::NotificationSource& source,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 bool using_oauth_; 220 bool using_oauth_;
222 221
223 base::WeakPtrFactory<LoginPerformer> weak_factory_; 222 base::WeakPtrFactory<LoginPerformer> weak_factory_;
224 223
225 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); 224 DISALLOW_COPY_AND_ASSIGN(LoginPerformer);
226 }; 225 };
227 226
228 } // namespace chromeos 227 } // namespace chromeos
229 228
230 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ 229 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/language_switch_menu.cc ('k') | chrome/browser/chromeos/login/login_performer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698