| Index: chrome/browser/resources/options/managed_user_settings.js
|
| diff --git a/chrome/browser/resources/options/managed_user_settings.js b/chrome/browser/resources/options/managed_user_settings.js
|
| index 04322632128ed069927a43cefe3698e8e90cd0f4..bc13f2821e2568c424c41842b8b4aaf433a20683 100644
|
| --- a/chrome/browser/resources/options/managed_user_settings.js
|
| +++ b/chrome/browser/resources/options/managed_user_settings.js
|
| @@ -28,12 +28,15 @@ cr.define('options', function() {
|
| ManagedUserSettings.prototype = {
|
| // Inherit from OptionsPage.
|
| __proto__: OptionsPage.prototype,
|
| + authenticationChecked: false,
|
| + authenticationChecking: false,
|
|
|
| /**
|
| * Initialize the page.
|
| * @override
|
| */
|
| initializePage: function() {
|
| + var self = this;
|
| // Call base class implementation to start preference initialization.
|
| OptionsPage.prototype.initializePage.call(this);
|
|
|
| @@ -42,13 +45,52 @@ cr.define('options', function() {
|
| };
|
|
|
| $('managed-user-settings-confirm').onclick = function() {
|
| - OptionsPage.closeOverlay();
|
| + if ($('use-passphrase-checkbox').checked) {
|
| + chrome.send('isPassphraseSet');
|
| + } else {
|
| + OptionsPage.closeOverlay();
|
| + }
|
| };
|
|
|
| $('set-passphrase').onclick = function() {
|
| - // TODO(bauerb): Set passphrase
|
| + OptionsPage.navigateToPage('setPassphrase');
|
| };
|
| },
|
| + /** @override */
|
| + canShowPage: function() {
|
| + if (this.authenticationChecked)
|
| + return true;
|
| + if (!this.authenticationChecking) {
|
| + chrome.send('displayPassphraseDialog',
|
| + ['ManagedUserSettings.isAuthenticated']);
|
| + this.authenticationChecking = true;
|
| + }
|
| + return false;
|
| + },
|
| + didClosePage: function() {
|
| + // Reset the authentication of the custodian.
|
| + this.authenticationChecked = false;
|
| + chrome.send('endAuthentication');
|
| + },
|
| + };
|
| +
|
| + ManagedUserSettings.isAuthenticated = function(success) {
|
| + var instance = ManagedUserSettings.getInstance();
|
| + if (success) {
|
| + instance.authenticationChecked = true;
|
| + OptionsPage.navigateToPage('managedUser');
|
| + } else {
|
| + OptionsPage.closeOverlay();
|
| + }
|
| + instance.authenticationChecking = false;
|
| + };
|
| +
|
| + ManagedUserSettings.isPassphraseSet = function(success) {
|
| + if (success) {
|
| + OptionsPage.closeOverlay();
|
| + } else {
|
| + OptionsPage.navigateToPage('setPassphrase');
|
| + }
|
| };
|
|
|
| // Export
|
|
|