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

Side by Side Diff: chrome/browser/resources/md_user_manager/import_supervised_user.js

Issue 1916913010: MD User Manager: latest design change, css refactoring, accessiblity, and bug fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md-user-manager-stylesheets
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @fileoverview 'import-supervised-user' is a popup that allows user to select 6 * @fileoverview 'import-supervised-user' is a popup that allows user to select
7 * a supervised profile from a list of profiles to import on the current device. 7 * a supervised profile from a list of profiles to import on the current device.
8 */ 8 */
9 (function() { 9 (function() {
10 /** 10 /**
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 * @param {!Array<!SupervisedUser>} supervisedUsers 85 * @param {!Array<!SupervisedUser>} supervisedUsers
86 * @private 86 * @private
87 * @return {string} 87 * @return {string}
88 */ 88 */
89 getMessage_: function(supervisedUsers) { 89 getMessage_: function(supervisedUsers) {
90 return supervisedUsers.length > 0 ? this.i18n('supervisedUserImportText') : 90 return supervisedUsers.length > 0 ? this.i18n('supervisedUserImportText') :
91 this.i18n('noSupervisedUserImportText'); 91 this.i18n('noSupervisedUserImportText');
92 }, 92 },
93 93
94 /** 94 /**
95 * Computed binding that returns the appropriate class names for the HTML
96 * container of |supervisedUser| depending on whether it is on this device.
97 * @param {!SupervisedUser} supervisedUser
98 * @private
99 * @return {string}
100 */
101 getUserClassNames_: function(supervisedUser) {
102 var classNames = 'list-item';
103 if (!supervisedUser.onCurrentDevice)
104 classNames += ' selectable';
105 return classNames;
106 },
107
108 /**
109 * Hides the popup. 95 * Hides the popup.
110 * @private 96 * @private
111 */ 97 */
112 onCancelTap_: function() { 98 onCancelTap_: function() {
113 this.popupHidden_ = true; 99 this.popupHidden_ = true;
114 }, 100 },
115 101
116 /** 102 /**
117 * Returns true if the 'Import' button should be enabled and false otherwise. 103 * Returns true if the 'Import' button should be enabled and false otherwise.
118 * @private 104 * @private
(...skipping 12 matching lines...) Expand all
131 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_]; 117 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_];
132 if (this.signedInUser_ && supervisedUser) { 118 if (this.signedInUser_ && supervisedUser) {
133 // Event is caught by create-profile. 119 // Event is caught by create-profile.
134 this.fire('import', {supervisedUser: supervisedUser, 120 this.fire('import', {supervisedUser: supervisedUser,
135 signedInUser: this.signedInUser_}); 121 signedInUser: this.signedInUser_});
136 this.popupHidden_ = true; 122 this.popupHidden_ = true;
137 } 123 }
138 } 124 }
139 }); 125 });
140 })(); 126 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698