OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * Contains the possible types of Change Picture selections. | 6 * Contains the possible types of Change Picture selections. |
7 * @enum {string} | 7 * @enum {string} |
8 */ | 8 */ |
9 var ChangePictureSelectionTypes = { | 9 var ChangePictureSelectionTypes = { |
10 CAMERA: 'camera', | 10 CAMERA: 'camera', |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 }, | 192 }, |
193 | 193 |
194 /** | 194 /** |
195 * Handler for the 'profile-image-changed' event. | 195 * Handler for the 'profile-image-changed' event. |
196 * @param {string} imageUrl | 196 * @param {string} imageUrl |
197 * @param {boolean} selected | 197 * @param {boolean} selected |
198 * @private | 198 * @private |
199 */ | 199 */ |
200 receiveProfileImage_: function(imageUrl, selected) { | 200 receiveProfileImage_: function(imageUrl, selected) { |
201 this.profileImageUrl_ = imageUrl; | 201 this.profileImageUrl_ = imageUrl; |
202 this.$.profileImage.alt = this.i18n('profilePhoto'); | 202 this.$.profileImage.title = this.i18n('profilePhoto'); |
203 | 203 |
204 if (!selected) | 204 if (!selected) |
205 return; | 205 return; |
206 | 206 |
207 this.fallbackImage_ = this.$.profileImage; | 207 this.fallbackImage_ = this.$.profileImage; |
208 | 208 |
209 // If user is currently taking a photo, do not steal the focus. | 209 // If user is currently taking a photo, do not steal the focus. |
210 if (!this.selectedItem_ || | 210 if (!this.selectedItem_ || |
211 this.selectedItem_.dataset.type != ChangePictureSelectionTypes.CAMERA) { | 211 this.selectedItem_.dataset.type != ChangePictureSelectionTypes.CAMERA) { |
212 this.$.selector.select(this.$.selector.indexOf(this.$.profileImage)); | 212 this.$.selector.select(this.$.selector.indexOf(this.$.profileImage)); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 */ | 434 */ |
435 getAuthorWebsite_: function(selectedItem, defaultImages) { | 435 getAuthorWebsite_: function(selectedItem, defaultImages) { |
436 if (!this.isAuthorCreditShown_(selectedItem)) | 436 if (!this.isAuthorCreditShown_(selectedItem)) |
437 return ''; | 437 return ''; |
438 | 438 |
439 assert(selectedItem.dataset.defaultImageIndex !== null && | 439 assert(selectedItem.dataset.defaultImageIndex !== null && |
440 selectedItem.dataset.defaultImageIndex < defaultImages.length); | 440 selectedItem.dataset.defaultImageIndex < defaultImages.length); |
441 return defaultImages[selectedItem.dataset.defaultImageIndex].website; | 441 return defaultImages[selectedItem.dataset.defaultImageIndex].website; |
442 }, | 442 }, |
443 }); | 443 }); |
OLD | NEW |