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

Unified Diff: chrome/browser/resources/md_user_manager/create_profile.js

Issue 2950943002: MD Settings: Stop using IronMenuBehavior from cr-profile-avatar-selector-grid. (Closed)
Patch Set: Delete commented out test. 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/md_user_manager/create_profile.js
diff --git a/chrome/browser/resources/md_user_manager/create_profile.js b/chrome/browser/resources/md_user_manager/create_profile.js
index 1469f1a38e077e8a2fc574567c90dc561a827a28..cc5a0c3f5e7e78353538a66700f58a06bcacf973 100644
--- a/chrome/browser/resources/md_user_manager/create_profile.js
+++ b/chrome/browser/resources/md_user_manager/create_profile.js
@@ -41,10 +41,10 @@ Polymer({
},
/**
- * The currently selected profile icon URL. May be a data URL.
- * @private {string}
+ * The currently selected profile avatar, if any.
+ * @private {?AvatarIcon}
*/
- profileIconUrl_: {type: String, value: ''},
+ selectedAvatar_: Object,
/**
* True if the existing supervised users are being loaded.
@@ -142,8 +142,9 @@ Polymer({
'create-profile-warning', this.handleMessage_.bind(this));
this.addWebUIListener(
'create-profile-error', this.handleMessage_.bind(this));
- this.addWebUIListener(
- 'profile-icons-received', this.handleProfileIcons_.bind(this));
+ this.addWebUIListener('profile-icons-received', function(icons) {
+ this.availableIcons_ = icons;
+ }.bind(this));
this.addWebUIListener(
'profile-defaults-received', this.handleProfileDefaults_.bind(this));
this.addWebUIListener(
@@ -182,16 +183,6 @@ Polymer({
}
},
- /**
- * Handler for when the profile icons are pushed from the browser.
- * @param {!Array<!AvatarIcon>} icons
- * @private
- */
- handleProfileIcons_: function(icons) {
- this.availableIcons_ = icons;
- this.profileIconUrl_ = icons[0].url;
- },
-
/**
* Handler for when the profile defaults are pushed from the browser.
* @param {!ProfileInfo} profileInfo Default Info for the new profile.
@@ -365,8 +356,10 @@ Polymer({
this.createInProgress_ = true;
var createShortcut =
this.isProfileShortcutsEnabled_ && this.createShortcut_;
+ // Select the 1st avatar if none selected.
+ var selectedAvatar = this.selectedAvatar_ || this.availableIcons_[0];
this.browserProxy_.createProfile(
- this.profileName_, this.profileIconUrl_, createShortcut,
+ this.profileName_, selectedAvatar.url, createShortcut,
this.isSupervised_, '', custodianProfilePath);
},
@@ -469,17 +462,6 @@ Polymer({
return this.i18nAdvanced(id, opts);
},
- /**
- * Computed binding determining which profile icon button is toggled on.
- * @param {string} iconUrl icon URL of a given icon button.
- * @param {string} profileIconUrl Currently selected icon URL.
- * @return {boolean}
- * @private
- */
- isActiveIcon_: function(iconUrl, profileIconUrl) {
- return iconUrl == profileIconUrl;
- },
-
/**
* Computed binding determining whether the paper-spinner is active.
* @param {boolean} createInProgress Is create in progress?

Powered by Google App Engine
This is Rietveld 408576698