| Index: chrome/browser/resources/chromeos/login/saml_confirm_password.js
|
| diff --git a/chrome/browser/resources/chromeos/login/saml_confirm_password.js b/chrome/browser/resources/chromeos/login/saml_confirm_password.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2943b7c78116b45a55cbba6ff435784baf423269
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/chromeos/login/saml_confirm_password.js
|
| @@ -0,0 +1,55 @@
|
| +/* Copyright 2015 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.
|
| + */
|
| +
|
| +Polymer('saml-confirm-password', {
|
| + onClose: function() {
|
| + this.disabled = true;
|
| + this.$.cancelConfirmDlg.toggle();
|
| + },
|
| +
|
| + onConfirmCancel: function() {
|
| + this.fire('cancel');
|
| + },
|
| +
|
| + reset: function() {
|
| + this.$.cancelConfirmDlg.close();
|
| + this.disabled = false;
|
| + this.$.closeButton.hidden = false;
|
| + this.$.animatedPages.selected = 0;
|
| + this.$.passwordInput.inputValue = '';
|
| + },
|
| +
|
| + invalidate: function() {
|
| + this.$.passwordInput.setValid(false);
|
| + },
|
| +
|
| + focus: function() {
|
| + if (this.$.animatedPages.selected == 0)
|
| + this.$.passwordInput.focus();
|
| + },
|
| +
|
| + set disabled(value) {
|
| + this.$.confirmPasswordCard.classList.toggle('full-disabled', value);
|
| + this.$.passwordInput.disabled = value;
|
| + this.$.closeButton.disabled = value;
|
| + },
|
| +
|
| + ready: function() {
|
| + this.$.cancelConfirmDlg.addEventListener('core-overlay-close-completed',
|
| + function() {
|
| + this.disabled = false;
|
| + }.bind(this));
|
| + this.$.passwordInput.addEventListener('buttonClick', function() {
|
| + var inputPassword = this.$.passwordInput.inputValue;
|
| + this.$.passwordInput.inputValue = '';
|
| + if (!inputPassword) {
|
| + this.invalidate();
|
| + } else {
|
| + this.$.animatedPages.selected += 1;
|
| + this.$.closeButton.hidden = true;
|
| + this.fire('passwordEnter', {password: inputPassword});
|
| + }
|
| + }.bind(this))}
|
| +});
|
|
|