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

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: Address review comments. 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 /** @override */
James Hawkins 2013/02/20 17:24:56 nit: Blank line above this.
Adrian Kuegel 2013/02/20 18:05:02 Done.
52 canShowPage: function() {
53 return ManagedUserSettings.getInstance().authenticationState ==
54 options.ManagedUserAuthentication.AUTHENTICATED;
55 },
51 }; 56 };
52 57
53 // This is a class used for browsertests. 58 // This is a class used for browsertests.
54 var ManagedUserSetPassphraseForTesting = { 59 var ManagedUserSetPassphraseForTesting = {
55 getPassphraseInput: function() { 60 getPassphraseInput: function() {
56 return $('managed-user-passphrase'); 61 return $('managed-user-passphrase');
57 }, 62 },
58 getPassphraseConfirmInput: function() { 63 getPassphraseConfirmInput: function() {
59 return $('passphrase-confirm'); 64 return $('passphrase-confirm');
60 }, 65 },
61 getSavePassphraseButton: function() { 66 getSavePassphraseButton: function() {
62 return $('save-passphrase'); 67 return $('save-passphrase');
63 }, 68 },
64 updateDisplay: function() { 69 updateDisplay: function() {
65 return ManagedUserSetPassphraseOverlay.getInstance().updateDisplay_(); 70 return ManagedUserSetPassphraseOverlay.getInstance().updateDisplay_();
66 } 71 }
67 }; 72 };
68 73
69 // Export 74 // Export
70 return { 75 return {
71 ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay, 76 ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay,
72 ManagedUserSetPassphraseForTesting: ManagedUserSetPassphraseForTesting 77 ManagedUserSetPassphraseForTesting: ManagedUserSetPassphraseForTesting
73 }; 78 };
74 79
75 }); 80 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698