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

Unified Diff: chrome/browser/resources/chromeos/login/saml_confirm_password.js

Issue 1115993002: ChromeOS Gaia: SAML password confirmation dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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/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..5e6110a2e8659b7bc6f8f2a5bdd37e49b1ca21a0
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/saml_confirm_password.js
@@ -0,0 +1,57 @@
+/* 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.value = '';
+ },
+
+ invalidate: function() {
+ this.$.passwordInput.isInvalid = true;
+ },
+
+ focus: function() {
+ if (this.$.animatedPages.selected == 0)
+ this.$.passwordInput.focus();
+ },
+
+ onPasswordSubmitted: function() {
+ var inputPassword = this.$.passwordInput.value;
+ this.$.passwordInput.value = '';
+ if (!inputPassword) {
+ this.invalidate();
+ } else {
+ this.$.animatedPages.selected += 1;
+ this.$.closeButton.hidden = true;
+ this.fire('passwordEnter', {password: inputPassword});
+ }
+ },
+
+ set disabled(value) {
+ this.$.confirmPasswordCard.classList.toggle('full-disabled', value);
+ this.$.inputForm.disabled = value;
+ this.$.closeButton.disabled = value;
+ },
+
+ ready: function() {
+ this.$.cancelConfirmDlg.addEventListener('core-overlay-close-completed',
+ function() {
+ this.disabled = false;
+ }.bind(this));
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698