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

Unified 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: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/managed_user_set_passphrase.js
diff --git a/chrome/browser/resources/options/managed_user_set_passphrase.js b/chrome/browser/resources/options/managed_user_set_passphrase.js
new file mode 100644
index 0000000000000000000000000000000000000000..71e4e0eadcb4121a24c6e6e08f25d6501a27a211
--- /dev/null
+++ b/chrome/browser/resources/options/managed_user_set_passphrase.js
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('options', function() {
+ /** @const */ var OptionsPage = options.OptionsPage;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // ManagedUserSetPassphraseOverlay class:
+
+ /**
+ * Encapsulated handling of XXX.
Bernhard Bauer 2013/01/07 14:20:22 Wait, that does not sound right ;-)
+ * @constructor
+ */
+ function ManagedUserSetPassphraseOverlay() {
+ //this.activeNavTab = null;
Bernhard Bauer 2013/01/07 14:20:22 Please remove.
+ OptionsPage.call(
+ this,
+ 'setPassphrase',
+ loadTimeData.getString('setPassphraseTitle'),
+ 'managed-user-set-passphrase-overlay');
+ }
+
+ cr.addSingletonGetter(ManagedUserSetPassphraseOverlay);
+
+ ManagedUserSetPassphraseOverlay.prototype = {
+ __proto__: OptionsPage.prototype,
+
+ initializePage: function() {
+ OptionsPage.prototype.initializePage.call(this);
+ $('save-passphrase').onclick = function() {
+ if ($('passphrase-foo').value != $('passphrase-confirm').value) {
+ alert('passwords are not equal');
+ // TODO display proper error message here
Bernhard Bauer 2013/01/07 14:20:22 Format TODOs as TODO(ldap), to make it easier to g
Pam (message me for reviews) 2013/01/07 14:51:49 With a colon after the userid; i.e., TODO(akuegel
+ return;
+ }
+ if ($('passphrase-foo').value == '') {
+ alert('password should not be empty');
+ // TODO display proper error message here
+ return;
+ }
+ chrome.send('setPassphrase', [$('passphrase-foo').value]);
Pam (message me for reviews) 2013/01/07 14:51:49 Is chrome.send sufficiently robust to be sending a
Bernhard Bauer 2013/01/08 17:43:14 FWIW, sync also sends the passphrase in plaintext
Pam (message me for reviews) 2013/01/14 15:37:50 Fair enough, then.
+ $('passphrase-foo').value = '';
+ $('passphrase-confirm').value = '';
+ OptionsPage.closeOverlay();
+ };
+ },
+ };
+
+ // Export
+ return {
+ ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay
+ };
+
+});

Powered by Google App Engine
This is Rietveld 408576698