Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: chrome/browser/resources/options/managed_user_set_passphrase.js

Issue 11783008: Add a lock to the managed user settings page and require authentication for unlocking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix problem with some WebUI tests. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 /** @const */ var OptionsPage = options.OptionsPage; 6 /** @const */ var OptionsPage = options.OptionsPage;
7 7
8 ////////////////////////////////////////////////////////////////////////////// 8 //////////////////////////////////////////////////////////////////////////////
9 // ManagedUserSetPassphraseOverlay class: 9 // ManagedUserSetPassphraseOverlay class:
10 10
(...skipping 30 matching lines...) Expand all
41 updateDisplay_: function() { 41 updateDisplay_: function() {
42 var valid = 42 var valid =
43 $('passphrase-confirm').value == $('managed-user-passphrase').value; 43 $('passphrase-confirm').value == $('managed-user-passphrase').value;
44 $('passphrase-mismatch').hidden = valid; 44 $('passphrase-mismatch').hidden = valid;
45 $('passphrase-confirm').setCustomValidity( 45 $('passphrase-confirm').setCustomValidity(
46 valid ? '' : $('passphrase-mismatch').textContent); 46 valid ? '' : $('passphrase-mismatch').textContent);
47 $('save-passphrase').disabled = 47 $('save-passphrase').disabled =
48 !$('passphrase-confirm').validity.valid || 48 !$('passphrase-confirm').validity.valid ||
49 !$('managed-user-passphrase').validity.valid; 49 !$('managed-user-passphrase').validity.valid;
50 }, 50 },
51
52 /** @override */
53 canShowPage: function() {
54 return ManagedUserSettings.getInstance().authenticationState ==
55 options.ManagedUserAuthentication.AUTHENTICATED;
56 },
51 }; 57 };
52 58
53 // This is a class used for browsertests. 59 // This is a class used for browsertests.
54 var ManagedUserSetPassphraseForTesting = { 60 var ManagedUserSetPassphraseForTesting = {
55 getPassphraseInput: function() { 61 getPassphraseInput: function() {
56 return $('managed-user-passphrase'); 62 return $('managed-user-passphrase');
57 }, 63 },
58 getPassphraseConfirmInput: function() { 64 getPassphraseConfirmInput: function() {
59 return $('passphrase-confirm'); 65 return $('passphrase-confirm');
60 }, 66 },
61 getSavePassphraseButton: function() { 67 getSavePassphraseButton: function() {
62 return $('save-passphrase'); 68 return $('save-passphrase');
63 }, 69 },
64 updateDisplay: function() { 70 updateDisplay: function() {
65 return ManagedUserSetPassphraseOverlay.getInstance().updateDisplay_(); 71 return ManagedUserSetPassphraseOverlay.getInstance().updateDisplay_();
66 } 72 }
67 }; 73 };
68 74
69 // Export 75 // Export
70 return { 76 return {
71 ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay, 77 ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay,
72 ManagedUserSetPassphraseForTesting: ManagedUserSetPassphraseForTesting 78 ManagedUserSetPassphraseForTesting: ManagedUserSetPassphraseForTesting
73 }; 79 };
74 80
75 }); 81 });
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/options/managed_user_settings.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698