Chromium Code Reviews| Index: chrome/browser/resources/settings/people_page/manage_profile.js |
| diff --git a/chrome/browser/resources/settings/people_page/manage_profile.js b/chrome/browser/resources/settings/people_page/manage_profile.js |
| index 65cf8fc63d376f6f1099cbc4f5f394a6a3b29bef..24c9fea1d529c9b6d1edbde356e10c9a5177041f 100644 |
| --- a/chrome/browser/resources/settings/people_page/manage_profile.js |
| +++ b/chrome/browser/resources/settings/people_page/manage_profile.js |
| @@ -14,9 +14,14 @@ Polymer({ |
| properties: { |
| /** |
| - * The currently selected profile icon URL. May be a data URL. |
| + * The newly selected avatar. Populated only if the user manually changes |
| + * the avatar selection. The observer ensures that the changes are |
| + * propagated to the C++. |
| */ |
| - profileIconUrl: String, |
| + profileAvatar: { |
|
tommycli
2017/06/22 21:45:31
Since this property is no longer changed externall
dpapad
2017/06/22 23:22:48
Done.
|
| + type: Object, |
| + observer: 'profileAvatarChanged_', |
| + }, |
| /** |
| * The current profile name. |
| @@ -114,20 +119,14 @@ Polymer({ |
| }, |
| /** |
| - * Handler for when an avatar is activated. |
| - * @param {!Event} event |
| + * Handler for when the profile avatar is changed by the user. |
| * @private |
| */ |
| - onIconActivate_: function(event) { |
| - // Explicitly test against undefined, because even when an element has the |
| - // data-is-gaia-avatar attribute, dataset.isGaiaAvatar returns an empty |
| - // string, which is falsy. |
| - var isGaiaAvatar = event.detail.item.dataset.isGaiaAvatar !== undefined; |
| - |
| - if (isGaiaAvatar) |
| + profileAvatarChanged_: function() { |
| + if (this.profileAvatar.isGaiaAvatar) |
| this.browserProxy_.setProfileIconToGaiaAvatar(); |
| else |
| - this.browserProxy_.setProfileIconToDefaultAvatar(event.detail.selected); |
| + this.browserProxy_.setProfileIconToDefaultAvatar(this.profileAvatar.url); |
| }, |
| /** |