| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
| 7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
| 8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if (this.profileInfo_) | 209 if (this.profileInfo_) |
| 210 this.profileInfo_.name = name; | 210 this.profileInfo_.name = name; |
| 211 $(mode + '-profile-name').value = name; | 211 $(mode + '-profile-name').value = name; |
| 212 }, | 212 }, |
| 213 | 213 |
| 214 /** | 214 /** |
| 215 * Set an array of default icon URLs. These will be added to the grid that | 215 * Set an array of default icon URLs. These will be added to the grid that |
| 216 * the user will use to choose their profile icon. | 216 * the user will use to choose their profile icon. |
| 217 * @param {string} mode A label that specifies the type of dialog box which | 217 * @param {string} mode A label that specifies the type of dialog box which |
| 218 * is currently being viewed (i.e. 'create' or 'manage'). | 218 * is currently being viewed (i.e. 'create' or 'manage'). |
| 219 * @param {!Array.<string>} iconURLs An array of icon URLs. | 219 * @param {!Array<string>} iconURLs An array of icon URLs. |
| 220 * @param {Array.<string>} names An array of default names | 220 * @param {Array<string>} names An array of default names |
| 221 * corresponding to the icons. | 221 * corresponding to the icons. |
| 222 * @private | 222 * @private |
| 223 */ | 223 */ |
| 224 receiveDefaultProfileIconsAndNames_: function(mode, iconURLs, names) { | 224 receiveDefaultProfileIconsAndNames_: function(mode, iconURLs, names) { |
| 225 this.defaultProfileNames_ = names; | 225 this.defaultProfileNames_ = names; |
| 226 | 226 |
| 227 var grid = $(mode + '-profile-icon-grid'); | 227 var grid = $(mode + '-profile-icon-grid'); |
| 228 | 228 |
| 229 grid.dataModel = new ArrayDataModel(iconURLs); | 229 grid.dataModel = new ArrayDataModel(iconURLs); |
| 230 | 230 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 373 } |
| 374 }.bind(this); | 374 }.bind(this); |
| 375 }, | 375 }, |
| 376 | 376 |
| 377 /** | 377 /** |
| 378 * Callback which receives the list of existing supervised users. Checks if | 378 * Callback which receives the list of existing supervised users. Checks if |
| 379 * the currently entered name is the name of an already existing supervised | 379 * the currently entered name is the name of an already existing supervised |
| 380 * user. If yes, the user is prompted to import the existing supervised | 380 * user. If yes, the user is prompted to import the existing supervised |
| 381 * user, and the create button is disabled. | 381 * user, and the create button is disabled. |
| 382 * If the received list is empty, hides the "import" link. | 382 * If the received list is empty, hides the "import" link. |
| 383 * @param {Array.<Object>} supervisedUsers The list of existing supervised | 383 * @param {Array<Object>} supervisedUsers The list of existing supervised |
| 384 * users. | 384 * users. |
| 385 * @private | 385 * @private |
| 386 */ | 386 */ |
| 387 receiveExistingSupervisedUsers_: function(supervisedUsers) { | 387 receiveExistingSupervisedUsers_: function(supervisedUsers) { |
| 388 $('import-existing-supervised-user-link').hidden = | 388 $('import-existing-supervised-user-link').hidden = |
| 389 supervisedUsers.length === 0; | 389 supervisedUsers.length === 0; |
| 390 if (!$('create-profile-supervised').checked) | 390 if (!$('create-profile-supervised').checked) |
| 391 return; | 391 return; |
| 392 | 392 |
| 393 var newName = $('create-profile-name').value; | 393 var newName = $('create-profile-name').value; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 'updateSignedInStatus', | 874 'updateSignedInStatus', |
| 875 'updateSupervisedUsersAllowed', | 875 'updateSupervisedUsersAllowed', |
| 876 ]); | 876 ]); |
| 877 | 877 |
| 878 // Export | 878 // Export |
| 879 return { | 879 return { |
| 880 ManageProfileOverlay: ManageProfileOverlay, | 880 ManageProfileOverlay: ManageProfileOverlay, |
| 881 CreateProfileOverlay: CreateProfileOverlay, | 881 CreateProfileOverlay: CreateProfileOverlay, |
| 882 }; | 882 }; |
| 883 }); | 883 }); |
| OLD | NEW |