Chromium Code Reviews| Index: chrome/browser/chromeos/login/screens/user_selection_screen.cc |
| diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.cc b/chrome/browser/chromeos/login/screens/user_selection_screen.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d46952c98f5a15a481c20ebaf3aac56539bc9824 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/login/screens/user_selection_screen.cc |
| @@ -0,0 +1,75 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| + |
| +#include "base/logging.h" |
| +#include "chrome/browser/chromeos/login/screens/screen_observer.h" |
| +#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| + |
| +namespace chromeos { |
| + |
| +UserSelectionScreen::UserSelectionScreen() : handler_(NULL) { |
| +} |
| + |
| +UserSelectionScreen::~UserSelectionScreen() { |
| +} |
| + |
| +void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) { |
| + handler_ = handler; |
| +} |
| + |
| +void UserSelectionScreen::Init(const UserList& users) { |
| + users_ = users; |
| +} |
| + |
| +void UserSelectionScreen::OnBeforeUserRemoved(const std::string& username) { |
| + for (UserList::iterator it = users_.begin(); it != users_.end(); ++it) { |
| + if ((*it)->email() == username) { |
| + users_.erase(it); |
| + break; |
| + } |
| + } |
| +} |
| + |
| +void UserSelectionScreen::OnUserRemoved(const std::string& username) { |
| + if (!handler_) |
| + return; |
| + |
| + handler_->OnUserRemoved(username); |
| + // ToDo(antrim): |
|
Nikita (slow)
2014/05/20 12:14:29
nit: Remove this commented code.
|
| + /* |
| + removeUserPod(username); |
| + if (getUsers.isEmpty()) |
| + manager->GaiaToAddUser(std::string()l) |
| + */ |
| +} |
| + |
| +void UserSelectionScreen::OnUserImageChanged(const User& user) { |
| + if (!handler_) |
| + return; |
| + handler_->OnUserImageChanged(user); |
| + // TODO(antrim) : updateUserImage(user.email()) |
| +} |
| + |
| +void UserSelectionScreen::ShowUserPodButton( |
| + const std::string& username, |
| + const std::string& iconURL, |
| + const base::Closure& click_callback) { |
| + if (!handler_) |
| + return; |
| + handler_->ShowUserPodButton(username, iconURL, click_callback); |
| +} |
| + |
| +void UserSelectionScreen::HideUserPodButton(const std::string& username) { |
| + if (!handler_) |
| + return; |
| + handler_->HideUserPodButton(username); |
| +} |
| + |
| +const UserList& UserSelectionScreen::GetUsers() const { |
| + return users_; |
| +} |
| + |
| +} // namespace chromeos |