| 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> |
| 8 |
| 7 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/values.h" | 10 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 12 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 11 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_flow
.h" | 13 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_flow
.h" |
| 12 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 13 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 15 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 14 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 16 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 16 #include "chrome/browser/ui/webui/chromeos/login/oobe_screen.h" | 18 #include "chrome/browser/ui/webui/chromeos/login/oobe_screen.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 new base::DictionaryValue); | 415 new base::DictionaryValue); |
| 414 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); | 416 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); |
| 415 image_data->SetString("author", | 417 image_data->SetString("author", |
| 416 l10n_util::GetStringUTF16( | 418 l10n_util::GetStringUTF16( |
| 417 default_user_image::kDefaultImageAuthorIDs[i])); | 419 default_user_image::kDefaultImageAuthorIDs[i])); |
| 418 image_data->SetString("website", | 420 image_data->SetString("website", |
| 419 l10n_util::GetStringUTF16( | 421 l10n_util::GetStringUTF16( |
| 420 default_user_image::kDefaultImageWebsiteIDs[i])); | 422 default_user_image::kDefaultImageWebsiteIDs[i])); |
| 421 image_data->SetString("title", | 423 image_data->SetString("title", |
| 422 default_user_image::GetDefaultImageDescription(i)); | 424 default_user_image::GetDefaultImageDescription(i)); |
| 423 image_urls.Append(image_data.release()); | 425 image_urls.Append(std::move(image_data)); |
| 424 } | 426 } |
| 425 CallJS("setDefaultImages", image_urls); | 427 CallJS("setDefaultImages", image_urls); |
| 426 } | 428 } |
| 427 | 429 |
| 428 void SupervisedUserCreationScreenHandler::HandlePhotoTaken | 430 void SupervisedUserCreationScreenHandler::HandlePhotoTaken |
| 429 (const std::string& image_url) { | 431 (const std::string& image_url) { |
| 430 std::string mime_type, charset, raw_data; | 432 std::string mime_type, charset, raw_data; |
| 431 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data)) | 433 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data)) |
| 432 NOTREACHED(); | 434 NOTREACHED(); |
| 433 DCHECK_EQ("image/png", mime_type); | 435 DCHECK_EQ("image/png", mime_type); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { | 469 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { |
| 468 CallJS("setCameraPresent", present); | 470 CallJS("setCameraPresent", present); |
| 469 } | 471 } |
| 470 | 472 |
| 471 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( | 473 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( |
| 472 const base::ListValue* users) { | 474 const base::ListValue* users) { |
| 473 CallJS("setExistingSupervisedUsers", *users); | 475 CallJS("setExistingSupervisedUsers", *users); |
| 474 } | 476 } |
| 475 | 477 |
| 476 } // namespace chromeos | 478 } // namespace chromeos |
| OLD | NEW |