| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 delegate_->ImportSupervisedUserWithPassword(account_id.GetUserEmail(), | 391 delegate_->ImportSupervisedUserWithPassword(account_id.GetUserEmail(), |
| 392 password); | 392 password); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void SupervisedUserCreationScreenHandler::HandleAuthenticateManager( | 395 void SupervisedUserCreationScreenHandler::HandleAuthenticateManager( |
| 396 const AccountId& manager_raw_account_id, | 396 const AccountId& manager_raw_account_id, |
| 397 const std::string& manager_password) { | 397 const std::string& manager_password) { |
| 398 const AccountId manager_account_id = AccountId::FromUserEmailGaiaId( | 398 const AccountId manager_account_id = AccountId::FromUserEmailGaiaId( |
| 399 gaia::SanitizeEmail(manager_raw_account_id.GetUserEmail()), | 399 gaia::SanitizeEmail(manager_raw_account_id.GetUserEmail()), |
| 400 manager_raw_account_id.GetGaiaId()); | 400 manager_raw_account_id.GetGaiaId()); |
| 401 delegate_->AuthenticateManager(manager_account_id.GetUserEmail(), | 401 delegate_->AuthenticateManager(manager_account_id, manager_password); |
| 402 manager_password); | |
| 403 } | 402 } |
| 404 | 403 |
| 405 // TODO(antrim) : this is an explicit code duplications with UserImageScreen. | 404 // TODO(antrim) : this is an explicit code duplications with UserImageScreen. |
| 406 // It should be removed by issue 251179. | 405 // It should be removed by issue 251179. |
| 407 void SupervisedUserCreationScreenHandler::HandleGetImages() { | 406 void SupervisedUserCreationScreenHandler::HandleGetImages() { |
| 408 base::ListValue image_urls; | 407 base::ListValue image_urls; |
| 409 for (int i = user_manager::kFirstDefaultImageIndex; | 408 for (int i = user_manager::kFirstDefaultImageIndex; |
| 410 i < user_manager::kDefaultImagesCount; | 409 i < user_manager::kDefaultImagesCount; |
| 411 ++i) { | 410 ++i) { |
| 412 scoped_ptr<base::DictionaryValue> image_data(new base::DictionaryValue); | 411 scoped_ptr<base::DictionaryValue> image_data(new base::DictionaryValue); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { | 462 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { |
| 464 CallJS("setCameraPresent", present); | 463 CallJS("setCameraPresent", present); |
| 465 } | 464 } |
| 466 | 465 |
| 467 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( | 466 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( |
| 468 const base::ListValue* users) { | 467 const base::ListValue* users) { |
| 469 CallJS("setExistingSupervisedUsers", *users); | 468 CallJS("setExistingSupervisedUsers", *users); |
| 470 } | 469 } |
| 471 | 470 |
| 472 } // namespace chromeos | 471 } // namespace chromeos |
| OLD | NEW |