| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 host_(host), | 73 host_(host), |
| 74 num_login_attempts_(0), | 74 num_login_attempts_(0), |
| 75 user_settings_(new UserCrosSettingsProvider), | 75 user_settings_(new UserCrosSettingsProvider), |
| 76 method_factory_(this) { | 76 method_factory_(this) { |
| 77 DCHECK(current_controller_ == NULL); | 77 DCHECK(current_controller_ == NULL); |
| 78 current_controller_ = this; | 78 current_controller_ = this; |
| 79 | 79 |
| 80 login_display_ = host_->CreateLoginDisplay(this); | 80 login_display_ = host_->CreateLoginDisplay(this); |
| 81 | 81 |
| 82 registrar_.Add(this, | 82 registrar_.Add(this, |
| 83 NotificationType::LOGIN_USER_IMAGE_CHANGED, | 83 chrome::LOGIN_USER_IMAGE_CHANGED, |
| 84 NotificationService::AllSources()); | 84 NotificationService::AllSources()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ExistingUserController::Init(const UserVector& users) { | 87 void ExistingUserController::Init(const UserVector& users) { |
| 88 UserVector filtered_users; | 88 UserVector filtered_users; |
| 89 if (UserCrosSettingsProvider::cached_show_users_on_signin()) { | 89 if (UserCrosSettingsProvider::cached_show_users_on_signin()) { |
| 90 for (size_t i = 0; i < users.size(); ++i) | 90 for (size_t i = 0; i < users.size(); ++i) |
| 91 // TODO(xiyuan): Clean user profile whose email is not in whitelist. | 91 // TODO(xiyuan): Clean user profile whose email is not in whitelist. |
| 92 if (UserCrosSettingsProvider::cached_allow_new_user() || | 92 if (UserCrosSettingsProvider::cached_allow_new_user() || |
| 93 UserCrosSettingsProvider::IsEmailInCachedWhitelist( | 93 UserCrosSettingsProvider::IsEmailInCachedWhitelist( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 StartAutomaticFreeDiskSpaceControl(); | 110 StartAutomaticFreeDiskSpaceControl(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 //////////////////////////////////////////////////////////////////////////////// | 113 //////////////////////////////////////////////////////////////////////////////// |
| 114 // ExistingUserController, NotificationObserver implementation: | 114 // ExistingUserController, NotificationObserver implementation: |
| 115 // | 115 // |
| 116 | 116 |
| 117 void ExistingUserController::Observe(NotificationType type, | 117 void ExistingUserController::Observe(NotificationType type, |
| 118 const NotificationSource& source, | 118 const NotificationSource& source, |
| 119 const NotificationDetails& details) { | 119 const NotificationDetails& details) { |
| 120 if (type != NotificationType::LOGIN_USER_IMAGE_CHANGED) | 120 if (type != chrome::LOGIN_USER_IMAGE_CHANGED) |
| 121 return; | 121 return; |
| 122 | 122 |
| 123 UserManager::User* user = Details<UserManager::User>(details).ptr(); | 123 UserManager::User* user = Details<UserManager::User>(details).ptr(); |
| 124 login_display_->OnUserImageChanged(user); | 124 login_display_->OnUserImageChanged(user); |
| 125 } | 125 } |
| 126 | 126 |
| 127 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
| 128 // ExistingUserController, private: | 128 // ExistingUserController, private: |
| 129 | 129 |
| 130 ExistingUserController::~ExistingUserController() { | 130 ExistingUserController::~ExistingUserController() { |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 519 } |
| 520 if (CrosLibrary::Get()->EnsureLoaded()) { | 520 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 521 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); | 521 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); |
| 522 cryptohomed->AsyncSetOwnerUser( | 522 cryptohomed->AsyncSetOwnerUser( |
| 523 UserCrosSettingsProvider::cached_owner(), NULL); | 523 UserCrosSettingsProvider::cached_owner(), NULL); |
| 524 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); | 524 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace chromeos | 528 } // namespace chromeos |
| OLD | NEW |