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

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

Issue 2602973002: Add Active Directory password change screen. (Closed)
Patch Set: Addressing Michael's comments. Created 3 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/chromeos/login/active_directory_password_change.js
diff --git a/chrome/browser/resources/chromeos/login/active_directory_password_change.js b/chrome/browser/resources/chromeos/login/active_directory_password_change.js
new file mode 100644
index 0000000000000000000000000000000000000000..2ba38f7ee7e1420e58b8658a4c1ff64c539bc985
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/active_directory_password_change.js
@@ -0,0 +1,66 @@
+// Copyright 2016 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.
+
+/**
+ * @fileoverview Polymer element for Active Directory password change screen.
+ */
+Polymer({
+ is: 'active-directory-password-change',
+
+ properties: {
+ /**
+ * The user principal name.
+ */
+ username: String,
+ },
+
+ /** @public */
+ reset: function() {
+ this.$.animatedPages.selected = 0;
+ this.$.oldPassword.value = '';
+ this.$.newPassword1.value = '';
+ this.$.newPassword2.value = '';
+ this.updateNavigation_();
+ },
+
+ /** @private */
+ computeWelcomeMessage_: function(username) {
+ return loadTimeData.getStringF('adPasswordChangeMessage', username);
+ },
+
+ /** @private */
+ onSubmit_: function() {
+ if (!this.$.oldPassword.checkValidity() ||
+ !this.$.newPassword1.checkValidity()) {
+ return;
+ }
+ if (this.$.newPassword1.value != this.$.newPassword2.value) {
+ this.$.newPassword2.isInvalid = true;
+ return;
+ }
+ this.$.animatedPages.selected++;
+ this.updateNavigation_();
+ var msg = {
+ 'username': this.username,
+ 'oldPassword': this.$.oldPassword.value,
+ 'newPassword': this.$.newPassword1.value,
+ };
+ this.$.oldPassword.value = '';
+ this.$.newPassword1.value = '';
+ this.$.newPassword2.value = '';
+ this.fire('authCompleted', msg);
+ },
+
+ /** @private */
+ onClose_: function() {
+ if (!this.$.navigation.closeVisible)
+ return;
+ this.fire('cancel');
+ },
+
+ /** @private */
+ updateNavigation_: function() {
+ this.$.navigation.closeVisible = (this.$.animatedPages.selected == 0);
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698