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

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

Issue 2950943002: MD Settings: Stop using IronMenuBehavior from cr-profile-avatar-selector-grid. (Closed)
Patch Set: Added comment. Created 3 years, 6 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/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..50e6a87e3d5dfa3a334093c7dc20d557635a9a00 100644
--- a/chrome/browser/resources/settings/people_page/manage_profile.js
+++ b/chrome/browser/resources/settings/people_page/manage_profile.js
@@ -14,9 +14,15 @@ 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++.
+ * @private
*/
- profileIconUrl: String,
+ profileAvatar_: {
+ type: Object,
+ observer: 'profileAvatarChanged_',
+ },
/**
* The current profile name.
@@ -114,20 +120,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);
},
/**

Powered by Google App Engine
This is Rietveld 408576698