| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * The default user images. | 83 * The default user images. |
| 84 * @private {!Array<!settings.DefaultImage>} | 84 * @private {!Array<!settings.DefaultImage>} |
| 85 */ | 85 */ |
| 86 defaultImages_: { | 86 defaultImages_: { |
| 87 type: Array, | 87 type: Array, |
| 88 value: function() { return []; }, | 88 value: function() { return []; }, |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 /** | |
| 92 * The fallback image to be selected when the user discards the Old image. | |
| 93 * This may be null if the user started with the Old image. | |
| 94 * @private {?ChangePictureImageElement} | |
| 95 */ | |
| 96 fallbackImage_: Object, | |
| 97 | |
| 98 /** | |
| 99 * Type of the last selected icon. This is used to jump back to the camera | |
| 100 * after the user discards a newly taken photo. | |
| 101 * @private {string} | |
| 102 */ | |
| 103 lastSelectedImageType_: { | |
| 104 type: String, | |
| 105 value: '', | |
| 106 }, | |
| 107 | |
| 108 /** @private */ | 91 /** @private */ |
| 109 selectionTypesEnum_: { | 92 selectionTypesEnum_: { |
| 110 type: Object, | 93 type: Object, |
| 111 value: ChangePictureSelectionTypes, | 94 value: ChangePictureSelectionTypes, |
| 112 readOnly: true, | 95 readOnly: true, |
| 113 }, | 96 }, |
| 97 }, |
| 114 | 98 |
| 115 /** @private {!settings.ChangePictureBrowserProxy} */ | 99 /** @private {?settings.ChangePictureBrowserProxy} */ |
| 116 browserProxy_: { | 100 browserProxy_: null, |
| 117 type: Object, | 101 |
| 118 value: function() { | 102 /** |
| 119 return settings.ChangePictureBrowserProxyImpl.getInstance(); | 103 * The fallback image to be selected when the user discards the Old image. |
| 120 }, | 104 * This may be null if the user started with the Old image. |
| 121 }, | 105 * @private {?ChangePictureImageElement} |
| 122 }, | 106 */ |
| 107 fallbackImage_: null, |
| 108 |
| 109 /** |
| 110 * Type of the last selected icon. This is used to jump back to the camera |
| 111 * after the user discards a newly taken photo. |
| 112 * @private {string} |
| 113 */ |
| 114 lastSelectedImageType_: '', |
| 123 | 115 |
| 124 /** @override */ | 116 /** @override */ |
| 125 attached: function() { | 117 attached: function() { |
| 118 this.browserProxy_ = settings.ChangePictureBrowserProxyImpl.getInstance(); |
| 126 this.addWebUIListener('default-images-changed', | 119 this.addWebUIListener('default-images-changed', |
| 127 this.receiveDefaultImages_.bind(this)); | 120 this.receiveDefaultImages_.bind(this)); |
| 128 this.addWebUIListener('selected-image-changed', | 121 this.addWebUIListener('selected-image-changed', |
| 129 this.receiveSelectedImage_.bind(this)); | 122 this.receiveSelectedImage_.bind(this)); |
| 130 this.addWebUIListener('old-image-changed', | 123 this.addWebUIListener('old-image-changed', |
| 131 this.receiveOldImage_.bind(this)); | 124 this.receiveOldImage_.bind(this)); |
| 132 this.addWebUIListener('profile-image-changed', | 125 this.addWebUIListener('profile-image-changed', |
| 133 this.receiveProfileImage_.bind(this)); | 126 this.receiveProfileImage_.bind(this)); |
| 134 this.addWebUIListener('camera-presence-changed', | 127 this.addWebUIListener('camera-presence-changed', |
| 135 this.receiveCameraPresence_.bind(this)); | 128 this.receiveCameraPresence_.bind(this)); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 */ | 441 */ |
| 449 getAuthorWebsite_: function(selectedItem, defaultImages) { | 442 getAuthorWebsite_: function(selectedItem, defaultImages) { |
| 450 if (!this.isAuthorCreditShown_(selectedItem)) | 443 if (!this.isAuthorCreditShown_(selectedItem)) |
| 451 return ''; | 444 return ''; |
| 452 | 445 |
| 453 assert(selectedItem.dataset.defaultImageIndex !== null && | 446 assert(selectedItem.dataset.defaultImageIndex !== null && |
| 454 selectedItem.dataset.defaultImageIndex < defaultImages.length); | 447 selectedItem.dataset.defaultImageIndex < defaultImages.length); |
| 455 return defaultImages[selectedItem.dataset.defaultImageIndex].website; | 448 return defaultImages[selectedItem.dataset.defaultImageIndex].website; |
| 456 }, | 449 }, |
| 457 }); | 450 }); |
| OLD | NEW |