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

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: Roman changes Created 5 years, 8 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..0b60c29d06d2d4a8ce7d9fbeb64fa30ad5e5d0f9
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/saml_confirm_password.js
@@ -0,0 +1,58 @@
+/* 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.$.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() {
bartfab (slow) 2015/04/30 12:39:49 Where is this triggered?
Roman Sorokin (ftl) 2015/04/30 15:03:04 in ConfirmPasswordScreen.onAfterShow
+ 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-open-completed',
+ function() {
bartfab (slow) 2015/04/30 12:39:49 Nit: Indentation.
Roman Sorokin (ftl) 2015/04/30 15:03:04 Done.
+ this.disabled = true;
bartfab (slow) 2015/04/30 12:39:48 Doesn't this mean that while the dialog is in the
Roman Sorokin (ftl) 2015/04/30 15:03:04 Moved to onClose
+ }.bind(this));
+ this.$.cancelConfirmDlg.addEventListener('core-overlay-close-completed',
+ function() {
bartfab (slow) 2015/04/30 12:39:48 Nit: Indentation.
Roman Sorokin (ftl) 2015/04/30 15:03:04 Done.
+ this.disabled = false;
+ }.bind(this));
+ this.$.passwordInput.addEventListener('buttonClick', function() {
+ var inputPassword = this.$.passwordInput.inputValue;
bartfab (slow) 2015/04/30 12:39:49 Nit: Should this block not be indented 2 spaces, n
Roman Sorokin (ftl) 2015/04/30 15:03:04 Done.
+ this.$.passwordInput.inputValue = '';
+ if (!inputPassword) {
+ this.invalidate();
+ } else {
+ this.$.animatedPages.selected += 1;
+ this.$.closeButton.hidden = true;
+ this.fire('passwordEnter', {password: inputPassword});
+ }
+ }.bind(this))}
+});

Powered by Google App Engine
This is Rietveld 408576698