| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 std::string mime_type, charset, raw_data; | 419 std::string mime_type, charset, raw_data; |
| 420 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data)) | 420 if (!net::DataURL::Parse(GURL(image_url), &mime_type, &charset, &raw_data)) |
| 421 NOTREACHED(); | 421 NOTREACHED(); |
| 422 DCHECK_EQ("image/png", mime_type); | 422 DCHECK_EQ("image/png", mime_type); |
| 423 | 423 |
| 424 if (delegate_) | 424 if (delegate_) |
| 425 delegate_->OnPhotoTaken(raw_data); | 425 delegate_->OnPhotoTaken(raw_data); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void SupervisedUserCreationScreenHandler::HandleTakePhoto() { | 428 void SupervisedUserCreationScreenHandler::HandleTakePhoto() { |
| 429 #if !defined(USE_ATHENA) |
| 430 // crbug.com/408733 |
| 429 ash::PlaySystemSoundIfSpokenFeedback(SOUND_CAMERA_SNAP); | 431 ash::PlaySystemSoundIfSpokenFeedback(SOUND_CAMERA_SNAP); |
| 432 #endif |
| 430 } | 433 } |
| 431 | 434 |
| 432 void SupervisedUserCreationScreenHandler::HandleDiscardPhoto() { | 435 void SupervisedUserCreationScreenHandler::HandleDiscardPhoto() { |
| 436 #if !defined(USE_ATHENA) |
| 433 ash::PlaySystemSoundIfSpokenFeedback(SOUND_OBJECT_DELETE); | 437 ash::PlaySystemSoundIfSpokenFeedback(SOUND_OBJECT_DELETE); |
| 438 #endif |
| 434 } | 439 } |
| 435 | 440 |
| 436 void SupervisedUserCreationScreenHandler::HandleSelectImage( | 441 void SupervisedUserCreationScreenHandler::HandleSelectImage( |
| 437 const std::string& image_url, | 442 const std::string& image_url, |
| 438 const std::string& image_type) { | 443 const std::string& image_type) { |
| 439 if (delegate_) | 444 if (delegate_) |
| 440 delegate_->OnImageSelected(image_type, image_url); | 445 delegate_->OnImageSelected(image_type, image_url); |
| 441 } | 446 } |
| 442 | 447 |
| 443 void SupervisedUserCreationScreenHandler::HandleCurrentSupervisedUserPage( | 448 void SupervisedUserCreationScreenHandler::HandleCurrentSupervisedUserPage( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 454 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { | 459 void SupervisedUserCreationScreenHandler::SetCameraPresent(bool present) { |
| 455 CallJS("setCameraPresent", present); | 460 CallJS("setCameraPresent", present); |
| 456 } | 461 } |
| 457 | 462 |
| 458 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( | 463 void SupervisedUserCreationScreenHandler::ShowExistingSupervisedUsers( |
| 459 const base::ListValue* users) { | 464 const base::ListValue* users) { |
| 460 CallJS("setExistingSupervisedUsers", *users); | 465 CallJS("setExistingSupervisedUsers", *users); |
| 461 } | 466 } |
| 462 | 467 |
| 463 } // namespace chromeos | 468 } // namespace chromeos |
| OLD | NEW |