| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/webui/chromeos/login/supervised_user_creation_screen
_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen
_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 225 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 226 std::unique_ptr<base::ListValue> users_list(new base::ListValue()); | 226 std::unique_ptr<base::ListValue> users_list(new base::ListValue()); |
| 227 const user_manager::UserList& users = | 227 const user_manager::UserList& users = |
| 228 ChromeUserManager::Get()->GetUsersAllowedForSupervisedUsersCreation(); | 228 ChromeUserManager::Get()->GetUsersAllowedForSupervisedUsersCreation(); |
| 229 std::string owner; | 229 std::string owner; |
| 230 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); | 230 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); |
| 231 | 231 |
| 232 for (user_manager::UserList::const_iterator it = users.begin(); | 232 for (user_manager::UserList::const_iterator it = users.begin(); |
| 233 it != users.end(); | 233 it != users.end(); |
| 234 ++it) { | 234 ++it) { |
| 235 bool is_owner = ((*it)->email() == owner); | 235 bool is_owner = ((*it)->GetAccountId().GetUserEmail() == owner); |
| 236 auto user_dict = base::MakeUnique<base::DictionaryValue>(); | 236 auto user_dict = base::MakeUnique<base::DictionaryValue>(); |
| 237 UserSelectionScreen::FillUserDictionary( | 237 UserSelectionScreen::FillUserDictionary( |
| 238 *it, is_owner, false, /* is_signin_to_add */ | 238 *it, is_owner, false, /* is_signin_to_add */ |
| 239 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 239 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
| 240 NULL, /* public_session_recommended_locales */ | 240 NULL, /* public_session_recommended_locales */ |
| 241 user_dict.get()); | 241 user_dict.get()); |
| 242 users_list->Append(std::move(user_dict)); | 242 users_list->Append(std::move(user_dict)); |
| 243 } | 243 } |
| 244 data->Set("managers", users_list.release()); | 244 data->Set("managers", users_list.release()); |
| 245 ShowScreenWithData(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW, | 245 ShowScreenWithData(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { | 470 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { |
| 471 CallJS("setCameraPresent", present); | 471 CallJS("setCameraPresent", present); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( | 474 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( |
| 475 const base::ListValue* users) { | 475 const base::ListValue* users) { |
| 476 CallJS("setExistingSupervisedUsers", *users); | 476 CallJS("setExistingSupervisedUsers", *users); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace chromeos | 479 } // namespace chromeos |
| OLD | NEW |