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

Side by Side Diff: chrome/browser/chromeos/login/ui/webui_login_display.cc

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 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" 5 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
6 6
7 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 7 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 8 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" 9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
10 #include "chrome/browser/chromeos/login/signin_screen_controller.h" 10 #include "chrome/browser/chromeos/login/signin_screen_controller.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // ---- User selection screen methods 73 // ---- User selection screen methods
74 74
75 void WebUILoginDisplay::HandleGetUsers() { 75 void WebUILoginDisplay::HandleGetUsers() {
76 SignInScreenController::Get()->SendUserList(); 76 SignInScreenController::Get()->SendUserList();
77 } 77 }
78 78
79 const user_manager::UserList& WebUILoginDisplay::GetUsers() const { 79 const user_manager::UserList& WebUILoginDisplay::GetUsers() const {
80 return SignInScreenController::Get()->GetUsers(); 80 return SignInScreenController::Get()->GetUsers();
81 } 81 }
82 82
83 void WebUILoginDisplay::CheckUserStatus(const std::string& user_id) { 83 void WebUILoginDisplay::CheckUserStatus(const user_manager::UserID& user_id) {
84 SignInScreenController::Get()->CheckUserStatus(user_id); 84 SignInScreenController::Get()->CheckUserStatus(user_id);
85 } 85 }
86 86
87 // ---- Gaia screen methods 87 // ---- Gaia screen methods
88 88
89 // ---- Not yet classified methods 89 // ---- Not yet classified methods
90 90
91 void WebUILoginDisplay::OnPreferencesChanged() { 91 void WebUILoginDisplay::OnPreferencesChanged() {
92 if (webui_handler_) 92 if (webui_handler_)
93 webui_handler_->OnPreferencesChanged(); 93 webui_handler_->OnPreferencesChanged();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 help_topic_id); 173 help_topic_id);
174 } 174 }
175 175
176 void WebUILoginDisplay::ShowErrorScreen(LoginDisplay::SigninError error_id) { 176 void WebUILoginDisplay::ShowErrorScreen(LoginDisplay::SigninError error_id) {
177 VLOG(1) << "Show error screen, error_id: " << error_id; 177 VLOG(1) << "Show error screen, error_id: " << error_id;
178 if (!webui_handler_) 178 if (!webui_handler_)
179 return; 179 return;
180 webui_handler_->ShowErrorScreen(error_id); 180 webui_handler_->ShowErrorScreen(error_id);
181 } 181 }
182 182
183 void WebUILoginDisplay::ShowGaiaPasswordChanged(const std::string& username) { 183 void WebUILoginDisplay::ShowGaiaPasswordChanged(const user_manager::UserID& user _id) {
184 if (webui_handler_) 184 if (webui_handler_)
185 webui_handler_->ShowGaiaPasswordChanged(username); 185 webui_handler_->ShowGaiaPasswordChanged(user_id);
186 } 186 }
187 187
188 void WebUILoginDisplay::ShowPasswordChangedDialog(bool show_password_error, 188 void WebUILoginDisplay::ShowPasswordChangedDialog(bool show_password_error,
189 const std::string& email) { 189 const user_manager::UserID& us er_id) {
190 if (webui_handler_) 190 if (webui_handler_)
191 webui_handler_->ShowPasswordChangedDialog(show_password_error, email); 191 webui_handler_->ShowPasswordChangedDialog(show_password_error, user_id);
192 } 192 }
193 193
194 void WebUILoginDisplay::ShowSigninUI(const std::string& email) { 194 void WebUILoginDisplay::ShowSigninUI(const user_manager::UserID& user_id) {
195 if (webui_handler_) 195 if (webui_handler_)
196 webui_handler_->ShowSigninUI(email); 196 webui_handler_->ShowSigninUI(user_id);
197 } 197 }
198 198
199 void WebUILoginDisplay::ShowWhitelistCheckFailedError() { 199 void WebUILoginDisplay::ShowWhitelistCheckFailedError() {
200 if (webui_handler_) 200 if (webui_handler_)
201 webui_handler_->ShowWhitelistCheckFailedError(); 201 webui_handler_->ShowWhitelistCheckFailedError();
202 } 202 }
203 203
204 // WebUILoginDisplay, NativeWindowDelegate implementation: --------------------- 204 // WebUILoginDisplay, NativeWindowDelegate implementation: ---------------------
205 gfx::NativeWindow WebUILoginDisplay::GetNativeWindow() const { 205 gfx::NativeWindow WebUILoginDisplay::GetNativeWindow() const {
206 return parent_window(); 206 return parent_window();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (delegate_) 239 if (delegate_)
240 delegate_->Login(user_context, specifics); 240 delegate_->Login(user_context, specifics);
241 } 241 }
242 242
243 void WebUILoginDisplay::MigrateUserData(const std::string& old_password) { 243 void WebUILoginDisplay::MigrateUserData(const std::string& old_password) {
244 DCHECK(delegate_); 244 DCHECK(delegate_);
245 if (delegate_) 245 if (delegate_)
246 delegate_->MigrateUserData(old_password); 246 delegate_->MigrateUserData(old_password);
247 } 247 }
248 248
249 void WebUILoginDisplay::LoadWallpaper(const std::string& username) { 249 void WebUILoginDisplay::LoadWallpaper(const user_manager::UserID& user_id) {
250 WallpaperManager::Get()->SetUserWallpaperDelayed(username); 250 WallpaperManager::Get()->SetUserWallpaperDelayed(user_id);
251 } 251 }
252 252
253 void WebUILoginDisplay::LoadSigninWallpaper() { 253 void WebUILoginDisplay::LoadSigninWallpaper() {
254 WallpaperManager::Get()->SetDefaultWallpaperDelayed( 254 WallpaperManager::Get()->SetDefaultWallpaperDelayed(
255 chromeos::login::kSignInUser); 255 chromeos::login::GetSignInUserID());
256 } 256 }
257 257
258 void WebUILoginDisplay::OnSigninScreenReady() { 258 void WebUILoginDisplay::OnSigninScreenReady() {
259 SignInScreenController::Get()->OnSigninScreenReady(); 259 SignInScreenController::Get()->OnSigninScreenReady();
260 260
261 if (delegate_) 261 if (delegate_)
262 delegate_->OnSigninScreenReady(); 262 delegate_->OnSigninScreenReady();
263 } 263 }
264 264
265 void WebUILoginDisplay::RemoveUser(const std::string& user_id) { 265 void WebUILoginDisplay::RemoveUser(const user_manager::UserID& user_id) {
266 SignInScreenController::Get()->RemoveUser(user_id); 266 SignInScreenController::Get()->RemoveUser(user_id);
267 } 267 }
268 268
269 void WebUILoginDisplay::ResyncUserData() { 269 void WebUILoginDisplay::ResyncUserData() {
270 DCHECK(delegate_); 270 DCHECK(delegate_);
271 if (delegate_) 271 if (delegate_)
272 delegate_->ResyncUserData(); 272 delegate_->ResyncUserData();
273 } 273 }
274 274
275 void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() { 275 void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() {
(...skipping 21 matching lines...) Expand all
297 delegate_->ShowWrongHWIDScreen(); 297 delegate_->ShowWrongHWIDScreen();
298 } 298 }
299 299
300 void WebUILoginDisplay::SetWebUIHandler( 300 void WebUILoginDisplay::SetWebUIHandler(
301 LoginDisplayWebUIHandler* webui_handler) { 301 LoginDisplayWebUIHandler* webui_handler) {
302 webui_handler_ = webui_handler; 302 webui_handler_ = webui_handler;
303 SignInScreenController::Get()->SetWebUIHandler(webui_handler_); 303 SignInScreenController::Get()->SetWebUIHandler(webui_handler_);
304 } 304 }
305 305
306 void WebUILoginDisplay::ShowSigninScreenForCreds( 306 void WebUILoginDisplay::ShowSigninScreenForCreds(
307 const std::string& username, 307 const user_manager::UserID& user_id,
308 const std::string& password) { 308 const std::string& password) {
309 if (webui_handler_) 309 if (webui_handler_)
310 webui_handler_->ShowSigninScreenForCreds(username, password); 310 webui_handler_->ShowSigninScreenForCreds(user_id, password);
311 } 311 }
312 312
313 bool WebUILoginDisplay::IsShowGuest() const { 313 bool WebUILoginDisplay::IsShowGuest() const {
314 return show_guest_; 314 return show_guest_;
315 } 315 }
316 316
317 bool WebUILoginDisplay::IsShowUsers() const { 317 bool WebUILoginDisplay::IsShowUsers() const {
318 return show_users_; 318 return show_users_;
319 } 319 }
320 320
(...skipping 14 matching lines...) Expand all
335 delegate_->Signout(); 335 delegate_->Signout();
336 } 336 }
337 337
338 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) { 338 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) {
339 if (delegate_) 339 if (delegate_)
340 delegate_->ResetPublicSessionAutoLoginTimer(); 340 delegate_->ResetPublicSessionAutoLoginTimer();
341 } 341 }
342 342
343 343
344 } // namespace chromeos 344 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698