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

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_user_image.js

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/resources/chromeos/login/oobe_screen_user_image.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
index 0db36dc087caf61db3cb95567615ae23394fb2ca..844437ff2fc34142d21cefc72fdd1eefae37786b 100644
--- a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
@@ -108,10 +108,7 @@ cr.define('login', function() {
// Toggle 'animation' class for the duration of WebKit transition.
$('flip-photo').addEventListener(
- 'click', function(e) {
- previewElement.classList.add('animation');
- imageGrid.flipPhoto = !imageGrid.flipPhoto;
- });
+ 'click', this.handleFlipPhoto_.bind(this));
$('user-image-stream-crop').addEventListener(
'webkitTransitionEnd', function(e) {
previewElement.classList.remove('animation');
@@ -198,7 +195,7 @@ cr.define('login', function() {
// Camera selection
if (imageGrid.selectionType == 'camera') {
- $('flip-photo').tabIndex = 0;
+ $('flip-photo').tabIndex = 1;
// No current image selected.
if (imageGrid.cameraLive) {
imageGrid.previewElement.classList.remove('phototaken');
@@ -242,10 +239,24 @@ cr.define('login', function() {
},
/**
+ * Handle camera-photo flip.
+ */
+ handleFlipPhoto_: function() {
+ var imageGrid = $('user-image-grid');
+ imageGrid.previewElement.classList.add('animation');
+ imageGrid.flipPhoto = !imageGrid.flipPhoto;
+ var flipMessageId = imageGrid.flipPhoto ?
+ 'photoFlippedAccessibleText' : 'photoFlippedBackAccessibleText';
+ this.announceAccessibleMessage_(
+ loadTimeData.getString(flipMessageId));
+ },
+
+ /**
* Handle photo capture from the live camera stream.
*/
handleTakePhoto_: function(e) {
$('user-image-grid').takePhoto();
+ chrome.send('takePhoto');
},
/**
@@ -272,6 +283,7 @@ cr.define('login', function() {
handleDiscardPhoto_: function(e) {
var imageGrid = $('user-image-grid');
imageGrid.discardPhoto();
+ chrome.send('discardPhoto');
this.announceAccessibleMessage_(
loadTimeData.getString('photoDiscardAccessibleText'));
},

Powered by Google App Engine
This is Rietveld 408576698