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

Side by Side Diff: chrome/browser/chromeos/login/lock/screen_locker.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/lock/screen_locker.h" 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 BrowserThread::PostTask( 281 BrowserThread::PostTask(
282 BrowserThread::UI, FROM_HERE, 282 BrowserThread::UI, FROM_HERE,
283 base::Bind(&ExtendedAuthenticator::AuthenticateToCheck, 283 base::Bind(&ExtendedAuthenticator::AuthenticateToCheck,
284 extended_authenticator_.get(), 284 extended_authenticator_.get(),
285 user_context, 285 user_context,
286 base::Closure())); 286 base::Closure()));
287 } 287 }
288 288
289 const user_manager::User* ScreenLocker::FindUnlockUser( 289 const user_manager::User* ScreenLocker::FindUnlockUser(
290 const std::string& user_id) { 290 const user_manager::UserID& user_id) {
291 const user_manager::User* unlock_user = NULL; 291 const user_manager::User* unlock_user = NULL;
292 for (user_manager::UserList::const_iterator it = users_.begin(); 292 for (user_manager::UserList::const_iterator it = users_.begin();
293 it != users_.end(); 293 it != users_.end();
294 ++it) { 294 ++it) {
295 if ((*it)->email() == user_id) { 295 if ((*it)->GetUserID() == user_id) {
296 unlock_user = *it; 296 unlock_user = *it;
297 break; 297 break;
298 } 298 }
299 } 299 }
300 return unlock_user; 300 return unlock_user;
301 } 301 }
302 302
303 void ScreenLocker::ClearErrors() { 303 void ScreenLocker::ClearErrors() {
304 delegate_->ClearErrors(); 304 delegate_->ClearErrors();
305 } 305 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 494
495 input_method::InputMethodManager::Get() 495 input_method::InputMethodManager::Get()
496 ->GetActiveIMEState() 496 ->GetActiveIMEState()
497 ->EnableLockScreenLayouts(); 497 ->EnableLockScreenLayouts();
498 } 498 }
499 499
500 content::WebUI* ScreenLocker::GetAssociatedWebUI() { 500 content::WebUI* ScreenLocker::GetAssociatedWebUI() {
501 return delegate_->GetAssociatedWebUI(); 501 return delegate_->GetAssociatedWebUI();
502 } 502 }
503 503
504 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { 504 bool ScreenLocker::IsUserLoggedIn(const user_manager::UserID& user_id) {
505 for (user_manager::UserList::const_iterator it = users_.begin(); 505 for (user_manager::UserList::const_iterator it = users_.begin();
506 it != users_.end(); 506 it != users_.end();
507 ++it) { 507 ++it) {
508 if ((*it)->email() == username) 508 if ((*it)->GetUserID() == user_id)
509 return true; 509 return true;
510 } 510 }
511 return false; 511 return false;
512 } 512 }
513 513
514 } // namespace chromeos 514 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698