| Index: chrome/browser/resources/md_user_manager/import_supervised_user.js
|
| diff --git a/chrome/browser/resources/md_user_manager/import_supervised_user.js b/chrome/browser/resources/md_user_manager/import_supervised_user.js
|
| index c572419b3e8da5cddd413dc744383d6f86c81a48..ff50e380595b4f633b06d1bd0de6db6b8ffed4d5 100644
|
| --- a/chrome/browser/resources/md_user_manager/import_supervised_user.js
|
| +++ b/chrome/browser/resources/md_user_manager/import_supervised_user.js
|
| @@ -7,99 +7,102 @@
|
| * a supervised profile from a list of profiles to import on the current device.
|
| */
|
| (function() {
|
| -/**
|
| - * It means no supervised user is selected.
|
| - * @const {number}
|
| - */
|
| -var NO_USER_SELECTED = -1;
|
| + /**
|
| + * It means no supervised user is selected.
|
| + * @const {number}
|
| + */
|
| + var NO_USER_SELECTED = -1;
|
|
|
| -Polymer({
|
| - is: 'import-supervised-user',
|
| + Polymer({
|
| + is: 'import-supervised-user',
|
|
|
| - behaviors: [
|
| - I18nBehavior,
|
| - ],
|
| + behaviors: [
|
| + I18nBehavior,
|
| + ],
|
|
|
| - properties: {
|
| - /**
|
| - * The currently signed in user and the custodian.
|
| - * @private {?SignedInUser}
|
| - */
|
| - signedInUser_: {
|
| - type: Object,
|
| - value: function() { return null; }
|
| + properties: {
|
| + /**
|
| + * The currently signed in user and the custodian.
|
| + * @private {?SignedInUser}
|
| + */
|
| + signedInUser_: {
|
| + type: Object,
|
| + value: function() {
|
| + return null;
|
| + }
|
| + },
|
| +
|
| + /**
|
| + * The list of supervised users managed by signedInUser_.
|
| + * @private {!Array<!SupervisedUser>}
|
| + */
|
| + supervisedUsers_: {
|
| + type: Array,
|
| + value: function() {
|
| + return [];
|
| + }
|
| + },
|
| +
|
| + /**
|
| + * Index of the selected supervised user.
|
| + * @private {number}
|
| + */
|
| + supervisedUserIndex_: {type: Number, value: NO_USER_SELECTED}
|
| },
|
|
|
| - /**
|
| - * The list of supervised users managed by signedInUser_.
|
| - * @private {!Array<!SupervisedUser>}
|
| - */
|
| - supervisedUsers_: {
|
| - type: Array,
|
| - value: function() { return []; }
|
| + /** override */
|
| + ready: function() {
|
| + this.$.dialog.lastFocusableNode = this.$.cancel;
|
| },
|
|
|
| /**
|
| - * Index of the selected supervised user.
|
| - * @private {number}
|
| + * Displays the dialog.
|
| + * @param {(!SignedInUser|undefined)} signedInUser
|
| + * @param {!Array<!SupervisedUser>} supervisedUsers
|
| */
|
| - supervisedUserIndex_: {
|
| - type: Number,
|
| - value: NO_USER_SELECTED
|
| - }
|
| - },
|
| + show: function(signedInUser, supervisedUsers) {
|
| + this.supervisedUsers_ = supervisedUsers;
|
| + this.supervisedUsers_.sort(function(a, b) {
|
| + if (a.onCurrentDevice != b.onCurrentDevice)
|
| + return a.onCurrentDevice ? 1 : -1;
|
| + return a.name.localeCompare(b.name);
|
| + });
|
|
|
| - /** override */
|
| - ready: function() {
|
| - this.$.dialog.lastFocusableNode = this.$.cancel;
|
| - },
|
| + this.supervisedUserIndex_ = NO_USER_SELECTED;
|
|
|
| - /**
|
| - * Displays the dialog.
|
| - * @param {(!SignedInUser|undefined)} signedInUser
|
| - * @param {!Array<!SupervisedUser>} supervisedUsers
|
| - */
|
| - show: function(signedInUser, supervisedUsers) {
|
| - this.supervisedUsers_ = supervisedUsers;
|
| - this.supervisedUsers_.sort(function(a, b) {
|
| - if (a.onCurrentDevice != b.onCurrentDevice)
|
| - return a.onCurrentDevice ? 1 : -1;
|
| - return a.name.localeCompare(b.name);
|
| - });
|
| -
|
| - this.supervisedUserIndex_ = NO_USER_SELECTED;
|
| -
|
| - this.signedInUser_ = signedInUser || null;
|
| - if (this.signedInUser_)
|
| - this.$.dialog.open();
|
| - },
|
| + this.signedInUser_ = signedInUser || null;
|
| + if (this.signedInUser_)
|
| + this.$.dialog.open();
|
| + },
|
|
|
| - /**
|
| + /**
|
| * param {number} supervisedUserIndex Index of the selected supervised user.
|
| * @private
|
| * @return {boolean} Whether the 'Import' button should be disabled.
|
| */
|
| - isImportDisabled_: function(supervisedUserIndex) {
|
| - var disabled = supervisedUserIndex == NO_USER_SELECTED;
|
| - if (!disabled) {
|
| - this.$.dialog.lastFocusableNode = this.$.import;
|
| - }
|
| - return disabled;
|
| - },
|
| + isImportDisabled_: function(supervisedUserIndex) {
|
| + var disabled = supervisedUserIndex == NO_USER_SELECTED;
|
| + if (!disabled) {
|
| + this.$.dialog.lastFocusableNode = this.$.import;
|
| + }
|
| + return disabled;
|
| + },
|
|
|
| - /**
|
| - * Called when the user clicks the 'Import' button. it proceeds with importing
|
| - * the supervised user.
|
| - * @private
|
| - */
|
| - onImportTap_: function() {
|
| - var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_];
|
| - if (this.signedInUser_ && supervisedUser) {
|
| - this.$.dialog.close();
|
| - // Event is caught by create-profile.
|
| - this.fire('import', {supervisedUser: supervisedUser,
|
| - signedInUser: this.signedInUser_});
|
| + /**
|
| + * Called when the user clicks the 'Import' button. it proceeds with
|
| + * importing
|
| + * the supervised user.
|
| + * @private
|
| + */
|
| + onImportTap_: function() {
|
| + var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_];
|
| + if (this.signedInUser_ && supervisedUser) {
|
| + this.$.dialog.close();
|
| + // Event is caught by create-profile.
|
| + this.fire(
|
| + 'import',
|
| + {supervisedUser: supervisedUser, signedInUser: this.signedInUser_});
|
| + }
|
| }
|
| - }
|
| -});
|
| + });
|
| })();
|
|
|