OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_launch_signin_screen.h" | 5 #include "chrome/browser/chromeos/login/app_launch_signin_screen.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 8 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
9 #include "chrome/browser/chromeos/login/login_utils.h" | 9 #include "chrome/browser/chromeos/login/login_utils.h" |
10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | |
11 #include "chrome/browser/signin/screenlock_bridge.h" | |
12 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 10 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
13 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
15 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
16 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
17 | 15 |
18 namespace chromeos { | 16 namespace chromeos { |
19 | 17 |
20 UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL; | 18 UserManager* AppLaunchSigninScreen::test_user_manager_ = NULL; |
21 | 19 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 webui_handler_ = webui_handler; | 144 webui_handler_ = webui_handler; |
147 } | 145 } |
148 | 146 |
149 void AppLaunchSigninScreen::ShowSigninScreenForCreds( | 147 void AppLaunchSigninScreen::ShowSigninScreenForCreds( |
150 const std::string& username, | 148 const std::string& username, |
151 const std::string& password) { | 149 const std::string& password) { |
152 NOTREACHED(); | 150 NOTREACHED(); |
153 } | 151 } |
154 | 152 |
155 const UserList& AppLaunchSigninScreen::GetUsers() const { | 153 const UserList& AppLaunchSigninScreen::GetUsers() const { |
156 if (test_user_manager_) { | |
157 return test_user_manager_->GetUsers(); | |
158 } | |
159 return owner_user_list_; | 154 return owner_user_list_; |
160 } | 155 } |
161 | 156 |
162 bool AppLaunchSigninScreen::IsShowGuest() const { | 157 bool AppLaunchSigninScreen::IsShowGuest() const { |
163 return false; | 158 return false; |
164 } | 159 } |
165 | 160 |
166 bool AppLaunchSigninScreen::IsShowUsers() const { | 161 bool AppLaunchSigninScreen::IsShowUsers() const { |
167 return true; | 162 return true; |
168 } | 163 } |
169 | 164 |
| 165 bool AppLaunchSigninScreen::IsShowNewUser() const { |
| 166 return false; |
| 167 } |
| 168 |
170 bool AppLaunchSigninScreen::IsSigninInProgress() const { | 169 bool AppLaunchSigninScreen::IsSigninInProgress() const { |
171 // Return true to suppress network processing in the signin screen. | 170 // Return true to suppress network processing in the signin screen. |
172 return true; | 171 return true; |
173 } | 172 } |
174 | 173 |
175 bool AppLaunchSigninScreen::IsUserSigninCompleted() const { | 174 bool AppLaunchSigninScreen::IsUserSigninCompleted() const { |
176 return false; | 175 return false; |
177 } | 176 } |
178 | 177 |
179 void AppLaunchSigninScreen::SetDisplayEmail(const std::string& email) { | 178 void AppLaunchSigninScreen::SetDisplayEmail(const std::string& email) { |
(...skipping 16 matching lines...) Expand all Loading... |
196 0, | 195 0, |
197 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING_KIOSK), | 196 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING_KIOSK), |
198 std::string(), | 197 std::string(), |
199 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT_OFFLINE); | 198 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT_OFFLINE); |
200 } | 199 } |
201 | 200 |
202 void AppLaunchSigninScreen::OnLoginSuccess(const UserContext& user_context) { | 201 void AppLaunchSigninScreen::OnLoginSuccess(const UserContext& user_context) { |
203 delegate_->OnOwnerSigninSuccess(); | 202 delegate_->OnOwnerSigninSuccess(); |
204 } | 203 } |
205 | 204 |
206 void AppLaunchSigninScreen::HandleGetUsers() { | |
207 base::ListValue users_list; | |
208 const UserList& users = GetUsers(); | |
209 | |
210 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { | |
211 ScreenlockBridge::LockHandler::AuthType initial_auth_type = | |
212 UserSelectionScreen::ShouldForceOnlineSignIn(*it) | |
213 ? ScreenlockBridge::LockHandler::ONLINE_SIGN_IN | |
214 : ScreenlockBridge::LockHandler::OFFLINE_PASSWORD; | |
215 base::DictionaryValue* user_dict = new base::DictionaryValue(); | |
216 UserSelectionScreen::FillUserDictionary( | |
217 *it, true, false, initial_auth_type, user_dict); | |
218 users_list.Append(user_dict); | |
219 } | |
220 | |
221 webui_handler_->LoadUsers(users_list, false, false); | |
222 } | |
223 | |
224 void AppLaunchSigninScreen::SetAuthType( | |
225 const std::string& username, | |
226 ScreenlockBridge::LockHandler::AuthType auth_type) { | |
227 return; | |
228 } | |
229 | |
230 ScreenlockBridge::LockHandler::AuthType AppLaunchSigninScreen::GetAuthType( | |
231 const std::string& username) const { | |
232 return ScreenlockBridge::LockHandler::OFFLINE_PASSWORD; | |
233 } | |
234 | |
235 } // namespace chromeos | 205 } // namespace chromeos |
OLD | NEW |