OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 background_view_ = background_view; | 207 background_view_ = background_view; |
208 } | 208 } |
209 | 209 |
210 void ExistingUserController::LoginNewUser(const std::string& username, | 210 void ExistingUserController::LoginNewUser(const std::string& username, |
211 const std::string& password) { | 211 const std::string& password) { |
212 SelectNewUser(); | 212 SelectNewUser(); |
213 UserController* new_user = controllers_.back(); | 213 UserController* new_user = controllers_.back(); |
214 DCHECK(new_user->is_new_user()); | 214 DCHECK(new_user->is_new_user()); |
215 if (!new_user->is_new_user()) | 215 if (!new_user->is_new_user()) |
216 return; | 216 return; |
217 NewUserView* new_user_view = new_user->new_user_view(); | |
218 new_user_view->SetUsername(username); | |
219 | 217 |
220 if (password.empty()) | 218 if (password.empty()) |
221 return; | 219 return; |
222 | 220 |
223 new_user_view->SetPassword(password); | 221 new_user->OnLogin(username, password); |
224 new_user_view->Login(); | |
225 } | 222 } |
226 | 223 |
227 void ExistingUserController::SelectNewUser() { | 224 void ExistingUserController::SelectNewUser() { |
228 SelectUser(controllers_.size() - 1); | 225 SelectUser(controllers_.size() - 1); |
229 } | 226 } |
230 | 227 |
231 void ExistingUserController::SetStatusAreaEnabled(bool enable) { | 228 void ExistingUserController::SetStatusAreaEnabled(bool enable) { |
232 if (background_view_) { | 229 if (background_view_) { |
233 background_view_->SetStatusAreaEnabled(enable); | 230 background_view_->SetStatusAreaEnabled(enable); |
234 } | 231 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 background_window_ = NULL; | 351 background_window_ = NULL; |
355 | 352 |
356 controller->Init(screen_name, background_bounds_); | 353 controller->Init(screen_name, background_bounds_); |
357 controller->set_start_url(start_url_); | 354 controller->set_start_url(start_url_); |
358 controller->Show(); | 355 controller->Show(); |
359 | 356 |
360 // And schedule us for deletion. We delay for a second as the window manager | 357 // And schedule us for deletion. We delay for a second as the window manager |
361 // is doing an animation with our windows. | 358 // is doing an animation with our windows. |
362 DCHECK(!delete_scheduled_instance_); | 359 DCHECK(!delete_scheduled_instance_); |
363 delete_scheduled_instance_ = this; | 360 delete_scheduled_instance_ = this; |
361 | |
362 // Stop throbbers now to prevent throbbers be visible under the newly created | |
363 // windows. | |
364 for (std::vector<UserController*>::iterator iter = controllers_.begin(); | |
whywhat
2010/12/09 16:20:18
Using indices here would be shorter and more reada
altimofeev
2010/12/10 16:37:40
Good point! Done.
| |
365 iter != controllers_.end(); ++iter) { | |
366 (*iter)->StopThrobber(); | |
367 } | |
368 | |
364 delete_timer_.Start(base::TimeDelta::FromSeconds(1), this, | 369 delete_timer_.Start(base::TimeDelta::FromSeconds(1), this, |
365 &ExistingUserController::Delete); | 370 &ExistingUserController::Delete); |
366 } | 371 } |
367 | 372 |
368 void ExistingUserController::RemoveUser(UserController* source) { | 373 void ExistingUserController::RemoveUser(UserController* source) { |
369 ClearErrors(); | 374 ClearErrors(); |
370 | 375 |
371 // Owner is not allowed to be removed from the device. | 376 // Owner is not allowed to be removed from the device. |
372 // It must be enforced at upper levels. | 377 // It must be enforced at upper levels. |
373 DCHECK(user_settings_->RequestTrustedOwner(NULL)); | 378 DCHECK(user_settings_->RequestTrustedOwner(NULL)); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
613 void ExistingUserController::RecoverEncryptedData( | 618 void ExistingUserController::RecoverEncryptedData( |
614 const std::string& old_password) { | 619 const std::string& old_password) { |
615 login_performer_->RecoverEncryptedData(old_password); | 620 login_performer_->RecoverEncryptedData(old_password); |
616 } | 621 } |
617 | 622 |
618 void ExistingUserController::ResyncEncryptedData() { | 623 void ExistingUserController::ResyncEncryptedData() { |
619 login_performer_->ResyncEncryptedData(); | 624 login_performer_->ResyncEncryptedData(); |
620 } | 625 } |
621 | 626 |
622 } // namespace chromeos | 627 } // namespace chromeos |
OLD | NEW |