Chromium Code Reviews| 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 if (loadTimeData.getBoolean('managedUsersEnabled')) { | 5 if (loadTimeData.getBoolean('managedUsersEnabled')) { |
| 6 | 6 |
| 7 cr.define('options', function() { | 7 cr.define('options', function() { |
| 8 /** @const */ var OptionsPage = options.OptionsPage; | 8 /** @const */ var OptionsPage = options.OptionsPage; |
| 9 /** @const */ var SettingsDialog = options.SettingsDialog; | 9 /** @const */ var SettingsDialog = options.SettingsDialog; |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 OptionsPage.navigateToPage('manualExceptions'); | 66 OptionsPage.navigateToPage('manualExceptions'); |
| 67 uber.invokeMethodOnParent('setPath', {path: url}); | 67 uber.invokeMethodOnParent('setPath', {path: url}); |
| 68 uber.invokeMethodOnParent('setTitle', | 68 uber.invokeMethodOnParent('setTitle', |
| 69 {title: loadTimeData.getString('manualExceptionsTabTitle')}); | 69 {title: loadTimeData.getString('manualExceptionsTabTitle')}); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 $('get-content-packs-button').onclick = function(event) { | 72 $('get-content-packs-button').onclick = function(event) { |
| 73 window.open(loadTimeData.getString('getContentPacksURL')); | 73 window.open(loadTimeData.getString('getContentPacksURL')); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 $('set-passphrase').onclick = function() { | 76 $('set-passphrase').onclick = function() { |
|
Bernhard Bauer
2013/04/11 13:31:18
This should also be hidden on Chrome OS.
Adrian Kuegel
2013/04/11 15:56:10
True. And I should exclude the browsertest for set
| |
| 77 OptionsPage.navigateToPage('setPassphrase'); | 77 OptionsPage.navigateToPage('setPassphrase'); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 $('use-passphrase-checkbox').onclick = function() { | 80 $('use-passphrase-checkbox').onclick = function() { |
| 81 $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked; | 81 $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 var self = this; | 84 var self = this; |
| 85 | 85 |
| 86 $('lock-settings').onclick = function() { | 86 if (!cr.isChromeOS) { |
| 87 chrome.send('setElevated', [false]); | 87 $('lock-settings').onclick = function() { |
| 88 // The managed user is currently authenticated, so don't wait for a | 88 chrome.send('setElevated', [false]); |
| 89 // callback to set the new authentication state since a reset to not | 89 // The managed user is currently authenticated, so don't wait for a |
| 90 // elevated is done without showing the passphrase dialog. | 90 // callback to set the new authentication state since a reset to not |
| 91 self.authenticationState = ManagedUserAuthentication.UNAUTHENTICATED; | 91 // elevated is done without showing the passphrase dialog. |
| 92 self.enableControls(false); | 92 self.authenticationState = ManagedUserAuthentication.UNAUTHENTICATED; |
| 93 }; | 93 self.enableControls(false); |
| 94 }; | |
| 94 | 95 |
| 95 $('unlock-settings').onclick = function() { | 96 $('unlock-settings').onclick = function() { |
| 96 if (self.authenticationState == ManagedUserAuthentication.CHECKING) | 97 if (self.authenticationState == ManagedUserAuthentication.CHECKING) |
| 97 return; | 98 return; |
| 98 self.authenticationState = ManagedUserAuthentication.CHECKING; | 99 self.authenticationState = ManagedUserAuthentication.CHECKING; |
| 99 chrome.send('setElevated', [true]); | 100 chrome.send('setElevated', [true]); |
| 100 }; | 101 }; |
| 102 } | |
| 101 }, | 103 }, |
| 102 | 104 |
| 103 /** @override */ | 105 /** @override */ |
| 104 handleConfirm: function() { | 106 handleConfirm: function() { |
| 105 if ($('use-passphrase-checkbox').checked && !this.isPassphraseSet) { | 107 if ($('use-passphrase-checkbox').checked && !this.isPassphraseSet) { |
| 106 OptionsPage.navigateToPage('setPassphrase'); | 108 OptionsPage.navigateToPage('setPassphrase'); |
| 107 return; | 109 return; |
| 108 } | 110 } |
| 109 if (!$('use-passphrase-checkbox').checked) | 111 if (!$('use-passphrase-checkbox').checked) |
| 110 chrome.send('resetPassphrase'); | 112 chrome.send('resetPassphrase'); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 | 215 |
| 214 // Export | 216 // Export |
| 215 return { | 217 return { |
| 216 ManagedUserSettings: ManagedUserSettings, | 218 ManagedUserSettings: ManagedUserSettings, |
| 217 ManagedUserSettingsForTesting: ManagedUserSettingsForTesting, | 219 ManagedUserSettingsForTesting: ManagedUserSettingsForTesting, |
| 218 ManagedUserAuthentication: ManagedUserAuthentication | 220 ManagedUserAuthentication: ManagedUserAuthentication |
| 219 }; | 221 }; |
| 220 }); | 222 }); |
| 221 | 223 |
| 222 } | 224 } |
| OLD | NEW |