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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 */ | 453 */ |
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 |
Dan Beam
2014/09/12 03:32:13
/** @private */
Vitaly Pavlenko
2014/09/12 19:21:16
Done.
| |
464 updateSignedInStatus_: assertNotReached, | |
465 | |
464 /** | 466 /** |
465 * Called when the user clicks "OK" or hits enter. Creates the profile | 467 * Called when the user clicks "OK" or hits enter. Creates the profile |
466 * using the information in the dialog. | 468 * using the information in the dialog. |
467 * @private | 469 * @private |
468 */ | 470 */ |
469 submitCreateProfile_: function() { | 471 submitCreateProfile_: function() { |
470 // This is visual polish: the UI to access this should be disabled for | 472 // 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. | 473 // supervised users, and the back end will prevent user creation anyway. |
472 if (this.profileInfo_ && this.profileInfo_.isSupervised) | 474 if (this.profileInfo_ && this.profileInfo_.isSupervised) |
473 return; | 475 return; |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
857 'updateSignedInStatus', | 859 'updateSignedInStatus', |
858 'updateSupervisedUsersAllowed', | 860 'updateSupervisedUsersAllowed', |
859 ]); | 861 ]); |
860 | 862 |
861 // Export | 863 // Export |
862 return { | 864 return { |
863 ManageProfileOverlay: ManageProfileOverlay, | 865 ManageProfileOverlay: ManageProfileOverlay, |
864 CreateProfileOverlay: CreateProfileOverlay, | 866 CreateProfileOverlay: CreateProfileOverlay, |
865 }; | 867 }; |
866 }); | 868 }); |
OLD | NEW |