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 // ToDo(antrim): | |
Nikita (slow)
2014/05/20 12:14:29
nit: Remove this commented code.
| |
42 /* | |
43 removeUserPod(username); | |
44 if (getUsers.isEmpty()) | |
45 manager->GaiaToAddUser(std::string()l) | |
46 */ | |
47 } | |
48 | |
49 void UserSelectionScreen::OnUserImageChanged(const User& user) { | |
50 if (!handler_) | |
51 return; | |
52 handler_->OnUserImageChanged(user); | |
53 // TODO(antrim) : updateUserImage(user.email()) | |
54 } | |
55 | |
56 void UserSelectionScreen::ShowUserPodButton( | |
57 const std::string& username, | |
58 const std::string& iconURL, | |
59 const base::Closure& click_callback) { | |
60 if (!handler_) | |
61 return; | |
62 handler_->ShowUserPodButton(username, iconURL, click_callback); | |
63 } | |
64 | |
65 void UserSelectionScreen::HideUserPodButton(const std::string& username) { | |
66 if (!handler_) | |
67 return; | |
68 handler_->HideUserPodButton(username); | |
69 } | |
70 | |
71 const UserList& UserSelectionScreen::GetUsers() const { | |
72 return users_; | |
73 } | |
74 | |
75 } // namespace chromeos | |
OLD | NEW |