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

Unified Diff: chrome/browser/resources/options/managed_user_set_passphrase.js

Issue 12210136: Revert 181812 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/managed_user_set_passphrase.js
===================================================================
--- chrome/browser/resources/options/managed_user_set_passphrase.js (revision 181897)
+++ chrome/browser/resources/options/managed_user_set_passphrase.js (working copy)
@@ -1,75 +0,0 @@
-// Copyright (c) 2013 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 the Managed User Set Passphrase page.
- * @constructor
- */
- function ManagedUserSetPassphraseOverlay() {
- OptionsPage.call(
- this,
- 'setPassphrase',
- loadTimeData.getString('setPassphraseTitle'),
- 'managed-user-set-passphrase-overlay');
- }
-
- cr.addSingletonGetter(ManagedUserSetPassphraseOverlay);
-
- ManagedUserSetPassphraseOverlay.prototype = {
- __proto__: OptionsPage.prototype,
-
- /** @override */
- initializePage: function() {
- OptionsPage.prototype.initializePage.call(this);
- $('managed-user-passphrase').oninput = this.updateDisplay_;
- $('passphrase-confirm').oninput = this.updateDisplay_;
-
- $('save-passphrase').onclick = function() {
- chrome.send('setPassphrase', [$('managed-user-passphrase').value]);
- $('managed-user-passphrase').value = '';
- $('passphrase-confirm').value = '';
- OptionsPage.closeOverlay();
- };
- },
- updateDisplay_: function() {
- var valid =
- $('passphrase-confirm').value == $('managed-user-passphrase').value;
- $('passphrase-mismatch').hidden = valid;
- $('passphrase-confirm').setCustomValidity(
- valid ? '' : $('passphrase-mismatch').textContent);
- $('save-passphrase').disabled =
- !$('passphrase-confirm').validity.valid ||
- !$('managed-user-passphrase').validity.valid;
- },
- };
-
- // This is a class used for browsertests.
- var ManagedUserSetPassphraseForTesting = {
- getPassphraseInput: function() {
- return $('managed-user-passphrase');
- },
- getPassphraseConfirmInput: function() {
- return $('passphrase-confirm');
- },
- getSavePassphraseButton: function() {
- return $('save-passphrase');
- },
- updateDisplay: function() {
- return ManagedUserSetPassphraseOverlay.getInstance().updateDisplay_();
- }
- };
-
- // Export
- return {
- ManagedUserSetPassphraseOverlay: ManagedUserSetPassphraseOverlay,
- ManagedUserSetPassphraseForTesting: ManagedUserSetPassphraseForTesting
- };
-
-});

Powered by Google App Engine
This is Rietveld 408576698