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

Side by Side Diff: chrome/browser/chromeos/login/screens/user_selection_screen.cc

Issue 1470633002: ChromeOS: Fix removeUser button on signin screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@462823--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Fix-GetKnownUserAccountId
Patch Set: Rebased. Created 5 years 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/screens/user_selection_screen.h" 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void UserSelectionScreen::Init(const user_manager::UserList& users, 257 void UserSelectionScreen::Init(const user_manager::UserList& users,
258 bool show_guest) { 258 bool show_guest) {
259 users_ = users; 259 users_ = users;
260 show_guest_ = show_guest; 260 show_guest_ = show_guest;
261 261
262 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); 262 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get();
263 if (!activity_detector->HasObserver(this)) 263 if (!activity_detector->HasObserver(this))
264 activity_detector->AddObserver(this); 264 activity_detector->AddObserver(this);
265 } 265 }
266 266
267 void UserSelectionScreen::OnBeforeUserRemoved(const std::string& username) { 267 void UserSelectionScreen::OnBeforeUserRemoved(const AccountId& account_id) {
268 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end(); 268 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end();
269 ++it) { 269 ++it) {
270 if ((*it)->email() == username) { 270 if ((*it)->GetAccountId() == account_id) {
271 users_.erase(it); 271 users_.erase(it);
272 break; 272 break;
273 } 273 }
274 } 274 }
275 } 275 }
276 276
277 void UserSelectionScreen::OnUserRemoved(const std::string& username) { 277 void UserSelectionScreen::OnUserRemoved(const AccountId& account_id) {
278 if (!handler_) 278 if (!handler_)
279 return; 279 return;
280 handler_->OnUserRemoved(username, users_.empty()); 280 handler_->OnUserRemoved(account_id, users_.empty());
281 } 281 }
282 282
283 void UserSelectionScreen::OnUserImageChanged(const user_manager::User& user) { 283 void UserSelectionScreen::OnUserImageChanged(const user_manager::User& user) {
284 if (!handler_) 284 if (!handler_)
285 return; 285 return;
286 handler_->OnUserImageChanged(user); 286 handler_->OnUserImageChanged(user);
287 // TODO(antrim) : updateUserImage(user.email()) 287 // TODO(antrim) : updateUserImage(user.email())
288 } 288 }
289 289
290 void UserSelectionScreen::OnPasswordClearTimerExpired() { 290 void UserSelectionScreen::OnPasswordClearTimerExpired() {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 // The user profile should exist if and only if this is the lock screen. 560 // The user profile should exist if and only if this is the lock screen.
561 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); 561 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN);
562 562
563 if (!profile) 563 if (!profile)
564 profile = profile_helper->GetSigninProfile(); 564 profile = profile_helper->GetSigninProfile();
565 565
566 return EasyUnlockService::Get(profile); 566 return EasyUnlockService::Get(profile);
567 } 567 }
568 568
569 } // namespace chromeos 569 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698