Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6908)

Unified Diff: chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc

Issue 158953002: Spoken feedback sounds for user photo capture/discard at image picker added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PlaySystemSound... functions introduced according to latest changes. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc
index ffa026b45a4a91deb708f92e5cc3367ee1666252..ae3230ddc0c971c2f1018e6d330a631ef2591184 100644
--- a/chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_screen_handler.h"
+#include "ash/audio/sounds.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_flow.h"
@@ -14,11 +15,14 @@
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chrome/common/url_constants.h"
+#include "chromeos/audio/chromeos_sounds.h"
#include "google_apis/gaia/gaia_auth_util.h"
+#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "net/base/data_url.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
const char kJsScreenPath[] = "login.LocallyManagedUserCreationScreen";
@@ -28,6 +32,12 @@ LocallyManagedUserCreationScreenHandler::
LocallyManagedUserCreationScreenHandler()
: BaseScreenHandler(kJsScreenPath),
delegate_(NULL) {
+ ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
+ media::SoundsManager* manager = media::SoundsManager::Get();
+ manager->Initialize(SOUND_OBJECT_DELETE,
+ bundle.GetRawDataResource(IDR_SOUND_OBJECT_DELETE_WAV));
+ manager->Initialize(SOUND_CAMERA_SNAP,
+ bundle.GetRawDataResource(IDR_SOUND_CAMERA_SNAP_WAV));
}
LocallyManagedUserCreationScreenHandler::
@@ -130,6 +140,11 @@ void LocallyManagedUserCreationScreenHandler::DeclareLocalizedValues(
builder->Add("takePhoto", IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO);
builder->Add("discardPhoto", IDS_OPTIONS_CHANGE_PICTURE_DISCARD_PHOTO);
builder->Add("flipPhoto", IDS_OPTIONS_CHANGE_PICTURE_FLIP_PHOTO);
+ builder->Add("photoFlippedAccessibleText",
+ IDS_OPTIONS_PHOTO_FLIP_ACCESSIBLE_TEXT);
+ builder->Add("photoFlippedBackAccessibleText",
+ IDS_OPTIONS_PHOTO_FLIPBACK_ACCESSIBLE_TEXT);
+
}
void LocallyManagedUserCreationScreenHandler::Initialize() {}
@@ -172,6 +187,10 @@ void LocallyManagedUserCreationScreenHandler::RegisterMessages() {
AddCallback("supervisedUserPhotoTaken",
&LocallyManagedUserCreationScreenHandler::HandlePhotoTaken);
+ AddCallback("supervisedUserPhotoTaken",
+ &LocallyManagedUserCreationScreenHandler::HandleTakePhoto);
+ AddCallback("supervisedUserPhotoTaken",
+ &LocallyManagedUserCreationScreenHandler::HandleDiscardPhoto);
AddCallback("supervisedUserSelectImage",
&LocallyManagedUserCreationScreenHandler::HandleSelectImage);
AddCallback("supervisedUserCheckCameraPresence",
@@ -391,6 +410,14 @@ void LocallyManagedUserCreationScreenHandler::HandlePhotoTaken
delegate_->OnPhotoTaken(raw_data);
}
+void LocallyManagedUserCreationScreenHandler::HandleTakePhoto() {
+ ash::PlaySystemSoundIfSpokenFeedback(SOUND_CAMERA_SNAP);
+}
+
+void LocallyManagedUserCreationScreenHandler::HandleDiscardPhoto() {
+ ash::PlaySystemSoundIfSpokenFeedback(SOUND_OBJECT_DELETE);
+}
+
void LocallyManagedUserCreationScreenHandler::HandleCheckCameraPresence() {
if (!delegate_)
return;

Powered by Google App Engine
This is Rietveld 408576698