| 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 "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 &SupervisedUserCreationScreenHandler:: | 204 &SupervisedUserCreationScreenHandler:: |
| 205 HandleCurrentSupervisedUserPage); | 205 HandleCurrentSupervisedUserPage); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void SupervisedUserCreationScreenHandler::PrepareToShow() {} | 208 void SupervisedUserCreationScreenHandler::PrepareToShow() {} |
| 209 | 209 |
| 210 void SupervisedUserCreationScreenHandler::Show() { | 210 void SupervisedUserCreationScreenHandler::Show() { |
| 211 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 211 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 212 scoped_ptr<base::ListValue> users_list(new base::ListValue()); | 212 scoped_ptr<base::ListValue> users_list(new base::ListValue()); |
| 213 const user_manager::UserList& users = | 213 const user_manager::UserList& users = |
| 214 user_manager::UserManager::Get() | 214 ChromeUserManager::Get()->GetUsersAllowedForSupervisedUsersCreation(); |
| 215 ->GetUsersAllowedForSupervisedUsersCreation(); | |
| 216 std::string owner; | 215 std::string owner; |
| 217 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); | 216 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); |
| 218 | 217 |
| 219 for (user_manager::UserList::const_iterator it = users.begin(); | 218 for (user_manager::UserList::const_iterator it = users.begin(); |
| 220 it != users.end(); | 219 it != users.end(); |
| 221 ++it) { | 220 ++it) { |
| 222 bool is_owner = ((*it)->email() == owner); | 221 bool is_owner = ((*it)->email() == owner); |
| 223 base::DictionaryValue* user_dict = new base::DictionaryValue(); | 222 base::DictionaryValue* user_dict = new base::DictionaryValue(); |
| 224 UserSelectionScreen::FillUserDictionary( | 223 UserSelectionScreen::FillUserDictionary( |
| 225 *it, | 224 *it, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { | 448 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { |
| 450 CallJS("setCameraPresent", present); | 449 CallJS("setCameraPresent", present); |
| 451 } | 450 } |
| 452 | 451 |
| 453 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( | 452 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( |
| 454 const base::ListValue* users) { | 453 const base::ListValue* users) { |
| 455 CallJS("setExistingSupervisedUsers", *users); | 454 CallJS("setExistingSupervisedUsers", *users); |
| 456 } | 455 } |
| 457 | 456 |
| 458 } // namespace chromeos | 457 } // namespace chromeos |
| OLD | NEW |