Chromium Code Reviews| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 void ExistingUserController::Init(const UserVector& users) { | 97 void ExistingUserController::Init(const UserVector& users) { |
| 98 UserVector filtered_users; | 98 UserVector filtered_users; |
| 99 bool show_users_on_signin; | 99 bool show_users_on_signin; |
| 100 | 100 |
| 101 // TODO(pastarmovj): Make this class an observer of the CrosSettings to be | 101 // TODO(pastarmovj): Make this class an observer of the CrosSettings to be |
| 102 // able to update the UI whenever policy is loaded. | 102 // able to update the UI whenever policy is loaded. |
| 103 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, | 103 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, |
| 104 &show_users_on_signin); | 104 &show_users_on_signin); |
| 105 if (show_users_on_signin) { | 105 if (show_users_on_signin) { |
| 106 bool allow_new_user = false; | 106 bool allow_new_user = false; |
| 107 const base::ListValue *user_list; | |
| 108 cros_settings_->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 107 cros_settings_->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 109 cros_settings_->GetList(kAccountsPrefUsers, &user_list); | |
| 110 for (size_t i = 0; i < users.size(); ++i) { | 108 for (size_t i = 0; i < users.size(); ++i) { |
| 111 base::StringValue email(users[i].email()); | |
| 112 // TODO(xiyuan): Clean user profile whose email is not in whitelist. | 109 // TODO(xiyuan): Clean user profile whose email is not in whitelist. |
| 113 if (allow_new_user || | 110 if (allow_new_user || |
| 114 user_list->Find(email) != user_list->end()) { | 111 cros_settings_->FindEmailInList(kAccountsPrefUsers, |
| 112 users[i].email())) { | |
|
Mattias Nissler (ping if slow)
2011/10/28 14:44:07
This is actually changing semantics to also show u
pastarmovj
2011/11/18 13:18:42
Yes this is going to leave emails of people whitel
| |
| 115 filtered_users.push_back(users[i]); | 113 filtered_users.push_back(users[i]); |
| 116 } | 114 } |
| 117 } | 115 } |
| 118 } | 116 } |
| 119 | 117 |
| 120 // If no user pods are visible, fallback to single new user pod which will | 118 // If no user pods are visible, fallback to single new user pod which will |
| 121 // have guest session link. | 119 // have guest session link. |
| 122 bool show_guest; | 120 bool show_guest; |
| 123 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &show_guest); | 121 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &show_guest); |
| 124 show_guest &= !filtered_users.empty(); | 122 show_guest &= !filtered_users.empty(); |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 std::string owner; | 611 std::string owner; |
| 614 cros_settings_->GetString(kDeviceOwner, &owner); | 612 cros_settings_->GetString(kDeviceOwner, &owner); |
| 615 cryptohomed->AsyncSetOwnerUser(owner, NULL); | 613 cryptohomed->AsyncSetOwnerUser(owner, NULL); |
| 616 // Do not invoke AsyncDoAutomaticFreeDiskSpaceControl(NULL) here | 614 // Do not invoke AsyncDoAutomaticFreeDiskSpaceControl(NULL) here |
| 617 // so it does not delay the following mount. Cleanup will be | 615 // so it does not delay the following mount. Cleanup will be |
| 618 // started in Cryptohomed by timer. | 616 // started in Cryptohomed by timer. |
| 619 } | 617 } |
| 620 } | 618 } |
| 621 | 619 |
| 622 } // namespace chromeos | 620 } // namespace chromeos |
| OLD | NEW |