| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 delete_scheduled_instance_ = this; | 349 delete_scheduled_instance_ = this; |
| 350 delete_timer_.Start(base::TimeDelta::FromSeconds(1), this, | 350 delete_timer_.Start(base::TimeDelta::FromSeconds(1), this, |
| 351 &ExistingUserController::Delete); | 351 &ExistingUserController::Delete); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void ExistingUserController::RemoveUser(UserController* source) { | 354 void ExistingUserController::RemoveUser(UserController* source) { |
| 355 ClearErrors(); | 355 ClearErrors(); |
| 356 | 356 |
| 357 UserManager::Get()->RemoveUser(source->user().email()); | 357 UserManager::Get()->RemoveUser(source->user().email()); |
| 358 | 358 |
| 359 // We need to unmap entry windows, the windows will be unmapped in destructor. | |
| 360 controllers_.erase(controllers_.begin() + source->user_index()); | 359 controllers_.erase(controllers_.begin() + source->user_index()); |
| 361 delete source; | |
| 362 | 360 |
| 363 EnableTooltipsIfNeeded(controllers_); | 361 EnableTooltipsIfNeeded(controllers_); |
| 362 |
| 363 // Update user count before unmapping windows, otherwise window manager won't |
| 364 // be in the right state. |
| 364 int new_size = static_cast<int>(controllers_.size()); | 365 int new_size = static_cast<int>(controllers_.size()); |
| 365 for (int i = 0; i < new_size; ++i) | 366 for (int i = 0; i < new_size; ++i) |
| 366 controllers_[i]->UpdateUserCount(i, new_size); | 367 controllers_[i]->UpdateUserCount(i, new_size); |
| 368 |
| 369 // We need to unmap entry windows, the windows will be unmapped in destructor. |
| 370 delete source; |
| 367 } | 371 } |
| 368 | 372 |
| 369 void ExistingUserController::SelectUser(int index) { | 373 void ExistingUserController::SelectUser(int index) { |
| 370 if (index >= 0 && index < static_cast<int>(controllers_.size()) && | 374 if (index >= 0 && index < static_cast<int>(controllers_.size()) && |
| 371 index != static_cast<int>(selected_view_index_)) { | 375 index != static_cast<int>(selected_view_index_)) { |
| 372 WmIpc::Message message(WM_IPC_MESSAGE_WM_SELECT_LOGIN_USER); | 376 WmIpc::Message message(WM_IPC_MESSAGE_WM_SELECT_LOGIN_USER); |
| 373 message.set_param(0, index); | 377 message.set_param(0, index); |
| 374 WmIpc::instance()->SendMessage(message); | 378 WmIpc::instance()->SendMessage(message); |
| 375 } | 379 } |
| 376 } | 380 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 void ExistingUserController::ResyncEncryptedData() { | 569 void ExistingUserController::ResyncEncryptedData() { |
| 566 ChromeThread::PostTask( | 570 ChromeThread::PostTask( |
| 567 ChromeThread::UI, FROM_HERE, | 571 ChromeThread::UI, FROM_HERE, |
| 568 NewRunnableMethod(authenticator_.get(), | 572 NewRunnableMethod(authenticator_.get(), |
| 569 &Authenticator::ResyncEncryptedData, | 573 &Authenticator::ResyncEncryptedData, |
| 570 cached_credentials_)); | 574 cached_credentials_)); |
| 571 cached_credentials_ = GaiaAuthConsumer::ClientLoginResult(); | 575 cached_credentials_ = GaiaAuthConsumer::ClientLoginResult(); |
| 572 } | 576 } |
| 573 | 577 |
| 574 } // namespace chromeos | 578 } // namespace chromeos |
| OLD | NEW |