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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.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_EXISTING_USER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/string16.h" 15 #include "base/string16.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/timer.h" 17 #include "base/timer.h"
18 #include "chrome/browser/chromeos/login/login_display.h" 18 #include "chrome/browser/chromeos/login/login_display.h"
19 #include "chrome/browser/chromeos/login/login_performer.h" 19 #include "chrome/browser/chromeos/login/login_performer.h"
20 #include "chrome/browser/chromeos/login/login_utils.h" 20 #include "chrome/browser/chromeos/login/login_utils.h"
21 #include "chrome/browser/chromeos/login/password_changed_view.h" 21 #include "chrome/browser/chromeos/login/password_changed_view.h"
22 #include "chrome/browser/chromeos/login/user.h" 22 #include "chrome/browser/chromeos/login/user.h"
23 #include "chrome/browser/chromeos/settings/device_settings_service.h" 23 #include "chrome/browser/chromeos/settings/ownership_service.h"
24 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #include "googleurl/src/gurl.h" 26 #include "googleurl/src/gurl.h"
27 #include "ui/gfx/rect.h" 27 #include "ui/gfx/rect.h"
28 28
29 namespace chromeos { 29 namespace chromeos {
30 30
31 class LoginDisplayHost;
31 class CrosSettings; 32 class CrosSettings;
32 class LoginDisplayHost;
33 33
34 // ExistingUserController is used to handle login when someone has 34 // ExistingUserController is used to handle login when someone has
35 // already logged into the machine. 35 // already logged into the machine.
36 // To use ExistingUserController create an instance of it and invoke Init. 36 // To use ExistingUserController create an instance of it and invoke Init.
37 // When Init is called it creates LoginDisplay instance which encapsulates 37 // When Init is called it creates LoginDisplay instance which encapsulates
38 // all login UI implementation. 38 // all login UI implementation.
39 // ExistingUserController maintains it's own life cycle and deletes itself when 39 // ExistingUserController maintains it's own life cycle and deletes itself when
40 // the user logs in (or chooses to see other settings). 40 // the user logs in (or chooses to see other settings).
41 class ExistingUserController : public LoginDisplay::Delegate, 41 class ExistingUserController : public LoginDisplay::Delegate,
42 public content::NotificationObserver, 42 public content::NotificationObserver,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Show error message. |error_id| error message ID in resources. 142 // Show error message. |error_id| error message ID in resources.
143 // If |details| string is not empty, it specify additional error text 143 // If |details| string is not empty, it specify additional error text
144 // provided by authenticator, it is not localized. 144 // provided by authenticator, it is not localized.
145 void ShowError(int error_id, const std::string& details); 145 void ShowError(int error_id, const std::string& details);
146 146
147 // Shows Gaia page because password change was detected. 147 // Shows Gaia page because password change was detected.
148 void ShowGaiaPasswordChanged(const std::string& username); 148 void ShowGaiaPasswordChanged(const std::string& username);
149 149
150 // Handles result of ownership check and starts enterprise enrollment if 150 // Handles result of ownership check and starts enterprise enrollment if
151 // applicable. 151 // applicable.
152 void OnEnrollmentOwnershipCheckCompleted( 152 void OnEnrollmentOwnershipCheckCompleted(OwnershipService::Status status,
153 DeviceSettingsService::OwnershipStatus status, 153 bool current_user_is_owner);
154 bool current_user_is_owner);
155 154
156 // Enters the enterprise enrollment screen. |forced| is true if this is the 155 // Enters the enterprise enrollment screen. |forced| is true if this is the
157 // result of an auto-enrollment check, and the user shouldn't be able to 156 // result of an auto-enrollment check, and the user shouldn't be able to
158 // easily cancel the enrollment. In that case, |user| is the user name that 157 // easily cancel the enrollment. In that case, |user| is the user name that
159 // first logged in. 158 // first logged in.
160 void ShowEnrollmentScreen(bool forced, const std::string& user); 159 void ShowEnrollmentScreen(bool forced, const std::string& user);
161 160
162 // Invoked to complete login. Login might be suspended if auto-enrollment 161 // Invoked to complete login. Login might be suspended if auto-enrollment
163 // has to be performed, and will resume once auto-enrollment completes. 162 // has to be performed, and will resume once auto-enrollment completes.
164 void CompleteLoginInternal(std::string username, std::string password); 163 void CompleteLoginInternal(std::string username, std::string password);
165 164
166 // Creates |login_performer_| if necessary and calls login() on it.
167 void PerformLogin(const std::string& username,
168 const std::string& password,
169 LoginPerformer::AuthorizationMode auth_mode,
170 DeviceSettingsService::OwnershipStatus ownership_status,
171 bool is_owner);
172
173 void set_login_performer_delegate(LoginPerformer::Delegate* d) { 165 void set_login_performer_delegate(LoginPerformer::Delegate* d) {
174 login_performer_delegate_.reset(d); 166 login_performer_delegate_.reset(d);
175 } 167 }
176 168
177 // Updates the |login_display_| attached to this controller. 169 // Updates the |login_display_| attached to this controller.
178 void UpdateLoginDisplay(const UserList& users); 170 void UpdateLoginDisplay(const UserList& users);
179 171
180 // Used to execute login operations. 172 // Used to execute login operations.
181 scoped_ptr<LoginPerformer> login_performer_; 173 scoped_ptr<LoginPerformer> login_performer_;
182 174
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 base::Time time_init_; 246 base::Time time_init_;
255 247
256 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); 248 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin);
257 249
258 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); 250 DISALLOW_COPY_AND_ASSIGN(ExistingUserController);
259 }; 251 };
260 252
261 } // namespace chromeos 253 } // namespace chromeos
262 254
263 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ 255 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/base_login_display_host.cc ('k') | chrome/browser/chromeos/login/existing_user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698