| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (this.profileInfo_) | 204 if (this.profileInfo_) |
| 205 this.profileInfo_.name = name; | 205 this.profileInfo_.name = name; |
| 206 $(mode + '-profile-name').value = name; | 206 $(mode + '-profile-name').value = name; |
| 207 }, | 207 }, |
| 208 | 208 |
| 209 /** | 209 /** |
| 210 * Set an array of default icon URLs. These will be added to the grid that | 210 * Set an array of default icon URLs. These will be added to the grid that |
| 211 * the user will use to choose their profile icon. | 211 * the user will use to choose their profile icon. |
| 212 * @param {string} mode A label that specifies the type of dialog box which | 212 * @param {string} mode A label that specifies the type of dialog box which |
| 213 * is currently being viewed (i.e. 'create' or 'manage'). | 213 * is currently being viewed (i.e. 'create' or 'manage'). |
| 214 * @param {Array.<string>} iconURLs An array of icon URLs. | 214 * @param {!Array.<string>} iconURLs An array of icon URLs. |
| 215 * @param {Array.<string>} names An array of default names | 215 * @param {Array.<string>} names An array of default names |
| 216 * corresponding to the icons. | 216 * corresponding to the icons. |
| 217 * @private | 217 * @private |
| 218 */ | 218 */ |
| 219 receiveDefaultProfileIconsAndNames_: function(mode, iconURLs, names) { | 219 receiveDefaultProfileIconsAndNames_: function(mode, iconURLs, names) { |
| 220 this.defaultProfileNames_ = names; | 220 this.defaultProfileNames_ = names; |
| 221 | 221 |
| 222 var grid = $(mode + '-profile-icon-grid'); | 222 var grid = $(mode + '-profile-icon-grid'); |
| 223 | 223 |
| 224 grid.dataModel = new ArrayDataModel(iconURLs); | 224 grid.dataModel = new ArrayDataModel(iconURLs); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 submitManageChanges_: function() { | 454 submitManageChanges_: function() { |
| 455 var name = $('manage-profile-name').value; | 455 var name = $('manage-profile-name').value; |
| 456 var iconURL = $('manage-profile-icon-grid').selectedItem; | 456 var iconURL = $('manage-profile-icon-grid').selectedItem; |
| 457 | 457 |
| 458 chrome.send('setProfileIconAndName', | 458 chrome.send('setProfileIconAndName', |
| 459 [this.profileInfo_.filePath, iconURL, name]); | 459 [this.profileInfo_.filePath, iconURL, name]); |
| 460 if (name != this.profileInfo_.name) | 460 if (name != this.profileInfo_.name) |
| 461 options.SupervisedUserListData.resetPromise(); | 461 options.SupervisedUserListData.resetPromise(); |
| 462 }, | 462 }, |
| 463 | 463 |
| 464 /** @private */ |
| 465 updateSignedInStatus_: assertNotReached, |
| 466 |
| 464 /** | 467 /** |
| 465 * Called when the user clicks "OK" or hits enter. Creates the profile | 468 * Called when the user clicks "OK" or hits enter. Creates the profile |
| 466 * using the information in the dialog. | 469 * using the information in the dialog. |
| 467 * @private | 470 * @private |
| 468 */ | 471 */ |
| 469 submitCreateProfile_: function() { | 472 submitCreateProfile_: function() { |
| 470 // This is visual polish: the UI to access this should be disabled for | 473 // This is visual polish: the UI to access this should be disabled for |
| 471 // supervised users, and the back end will prevent user creation anyway. | 474 // supervised users, and the back end will prevent user creation anyway. |
| 472 if (this.profileInfo_ && this.profileInfo_.isSupervised) | 475 if (this.profileInfo_ && this.profileInfo_.isSupervised) |
| 473 return; | 476 return; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 'updateSignedInStatus', | 860 'updateSignedInStatus', |
| 858 'updateSupervisedUsersAllowed', | 861 'updateSupervisedUsersAllowed', |
| 859 ]); | 862 ]); |
| 860 | 863 |
| 861 // Export | 864 // Export |
| 862 return { | 865 return { |
| 863 ManageProfileOverlay: ManageProfileOverlay, | 866 ManageProfileOverlay: ManageProfileOverlay, |
| 864 CreateProfileOverlay: CreateProfileOverlay, | 867 CreateProfileOverlay: CreateProfileOverlay, |
| 865 }; | 868 }; |
| 866 }); | 869 }); |
| OLD | NEW |