| 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 OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * ManageProfileOverlay class | 10 * ManageProfileOverlay class |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 */ | 289 */ |
| 290 onNameChanged_: function(mode) { | 290 onNameChanged_: function(mode) { |
| 291 var newName = $(mode + '-profile-name').value; | 291 var newName = $(mode + '-profile-name').value; |
| 292 var oldName = this.profileInfo_.name; | 292 var oldName = this.profileInfo_.name; |
| 293 | 293 |
| 294 // In 'create' mode, the initial name can be the name of an already | 294 // In 'create' mode, the initial name can be the name of an already |
| 295 // existing supervised user. | 295 // existing supervised user. |
| 296 if (newName == oldName && mode == 'manage') { | 296 if (newName == oldName && mode == 'manage') { |
| 297 this.hideErrorBubble_(mode); | 297 this.hideErrorBubble_(mode); |
| 298 } else if (mode == 'create' && | 298 } else if (mode == 'create' && |
| 299 loadTimeData.getBoolean('allowCreateExistingManagedUsers') && | 299 !loadTimeData.getBoolean( |
| 300 'disableCreateExistingManagedUsers') && |
| 300 $('create-profile-managed').checked) { | 301 $('create-profile-managed').checked) { |
| 301 options.ManagedUserListData.requestExistingManagedUsers().then( | 302 options.ManagedUserListData.requestExistingManagedUsers().then( |
| 302 this.receiveExistingManagedUsers_.bind(this), | 303 this.receiveExistingManagedUsers_.bind(this), |
| 303 this.onSigninError_.bind(this)); | 304 this.onSigninError_.bind(this)); |
| 304 } else { | 305 } else { |
| 305 this.updateOkButton_(mode); | 306 this.updateOkButton_(mode); |
| 306 } | 307 } |
| 307 }, | 308 }, |
| 308 | 309 |
| 309 /** | 310 /** |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 561 |
| 561 var shortcutsEnabled = loadTimeData.getBoolean('profileShortcutsEnabled'); | 562 var shortcutsEnabled = loadTimeData.getBoolean('profileShortcutsEnabled'); |
| 562 $('create-shortcut-container').hidden = !shortcutsEnabled; | 563 $('create-shortcut-container').hidden = !shortcutsEnabled; |
| 563 $('create-shortcut').checked = shortcutsEnabled; | 564 $('create-shortcut').checked = shortcutsEnabled; |
| 564 | 565 |
| 565 $('create-profile-name-label').hidden = true; | 566 $('create-profile-name-label').hidden = true; |
| 566 $('create-profile-name').hidden = true; | 567 $('create-profile-name').hidden = true; |
| 567 $('create-profile-ok').disabled = true; | 568 $('create-profile-ok').disabled = true; |
| 568 | 569 |
| 569 $('create-profile-managed').checked = false; | 570 $('create-profile-managed').checked = false; |
| 570 if (loadTimeData.getBoolean('allowCreateExistingManagedUsers')) { | 571 if (!loadTimeData.getBoolean('disableCreateExistingManagedUsers')) { |
| 571 $('import-existing-managed-user-link').hidden = false; | 572 $('import-existing-managed-user-link').hidden = false; |
| 572 $('create-profile-managed').onchange = function() { | 573 $('create-profile-managed').onchange = function() { |
| 573 ManageProfileOverlay.getInstance().onNameChanged_('create'); | 574 ManageProfileOverlay.getInstance().onNameChanged_('create'); |
| 574 }; | 575 }; |
| 575 } | 576 } |
| 576 $('create-profile-managed-signed-in').disabled = true; | 577 $('create-profile-managed-signed-in').disabled = true; |
| 577 $('create-profile-managed-signed-in').hidden = true; | 578 $('create-profile-managed-signed-in').hidden = true; |
| 578 $('create-profile-managed-not-signed-in').hidden = true; | 579 $('create-profile-managed-not-signed-in').hidden = true; |
| 579 }, | 580 }, |
| 580 | 581 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 return instance[name + '_'].apply(instance, arguments); | 776 return instance[name + '_'].apply(instance, arguments); |
| 776 }; | 777 }; |
| 777 }); | 778 }); |
| 778 | 779 |
| 779 // Export | 780 // Export |
| 780 return { | 781 return { |
| 781 ManageProfileOverlay: ManageProfileOverlay, | 782 ManageProfileOverlay: ManageProfileOverlay, |
| 782 CreateProfileOverlay: CreateProfileOverlay, | 783 CreateProfileOverlay: CreateProfileOverlay, |
| 783 }; | 784 }; |
| 784 }); | 785 }); |
| OLD | NEW |