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

Unified Diff: chrome/browser/resources/settings/people_page/change_picture.js

Issue 1714043003: Settings People Revamp: Change Picture Minor accessibility upgrades (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix closure compile Created 4 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/settings/people_page/change_picture.js
diff --git a/chrome/browser/resources/settings/people_page/change_picture.js b/chrome/browser/resources/settings/people_page/change_picture.js
index 384a02cc507054aefe42beb655489c99f028f993..0f6c7b7812c2d89aa6c4cf65377095db5d48b24c 100644
--- a/chrome/browser/resources/settings/people_page/change_picture.js
+++ b/chrome/browser/resources/settings/people_page/change_picture.js
@@ -160,6 +160,7 @@ Polymer({
*/
receiveProfileImage: function(imageUrl, selected) {
this.profileImageUrl_ = imageUrl;
+ this.$.profileImage.alt = this.i18n('profilePhoto');
if (!selected)
return;
@@ -235,8 +236,6 @@ Polymer({
*/
onPhotoTaken_: function(event) {
settings.ChangePicturePrivateApi.photoTaken(event.detail.photoDataUrl);
-
- // TODO(tommycli): Add announce of accessible message for photo capture.
},
/**
@@ -260,6 +259,9 @@ Polymer({
assert(this.defaultImages_.length > 0);
settings.ChangePicturePrivateApi.selectDefaultImage(
this.defaultImages_[0].url);
+
+ announceAccessibleMessage(
+ loadTimeData.getString('photoDiscardAccessibleText'));
},
/**
@@ -272,6 +274,19 @@ Polymer({
/**
* @param {settings.ChangePictureImageElement} selectedItem
+ * @return {boolean} True if the preview image should be hidden.
+ * @private
+ */
+ isPreviewImageHidden_: function(selectedItem) {
+ if (selectedItem == undefined)
+ return true;
+
+ var type = selectedItem.dataset.type;
+ return type != 'default' && type != 'profile' && type != 'old';
+ },
+
+ /**
+ * @param {settings.ChangePictureImageElement} selectedItem
* @return {boolean} True if the camera is selected in the image grid.
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698