OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/login/screens/screen_observer.h" |
| 9 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 UserSelectionScreen::UserSelectionScreen() : handler_(NULL) { |
| 14 } |
| 15 |
| 16 UserSelectionScreen::~UserSelectionScreen() { |
| 17 } |
| 18 |
| 19 void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) { |
| 20 handler_ = handler; |
| 21 } |
| 22 |
| 23 void UserSelectionScreen::Init(const UserList& users) { |
| 24 users_ = users; |
| 25 } |
| 26 |
| 27 void UserSelectionScreen::OnBeforeUserRemoved(const std::string& username) { |
| 28 for (UserList::iterator it = users_.begin(); it != users_.end(); ++it) { |
| 29 if ((*it)->email() == username) { |
| 30 users_.erase(it); |
| 31 break; |
| 32 } |
| 33 } |
| 34 } |
| 35 |
| 36 void UserSelectionScreen::OnUserRemoved(const std::string& username) { |
| 37 if (!handler_) |
| 38 return; |
| 39 |
| 40 handler_->OnUserRemoved(username); |
| 41 } |
| 42 |
| 43 void UserSelectionScreen::OnUserImageChanged(const User& user) { |
| 44 if (!handler_) |
| 45 return; |
| 46 handler_->OnUserImageChanged(user); |
| 47 // TODO(antrim) : updateUserImage(user.email()) |
| 48 } |
| 49 |
| 50 const UserList& UserSelectionScreen::GetUsers() const { |
| 51 return users_; |
| 52 } |
| 53 |
| 54 } // namespace chromeos |
OLD | NEW |