Chromium Code Reviews| 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..ec846ae6daced672835d1a9b15d4007215e29e47 |
| --- /dev/null |
| +++ b/chrome/browser/resources/chromeos/login/active_directory_password_change.js |
| @@ -0,0 +1,72 @@ |
| +// 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. |
| + */ |
| + |
|
michaelpg
2017/01/11 22:09:11
nit: remove blank line
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
|
| +Polymer({ |
| + is: 'active-directory-password-change', |
| + |
| + properties: { |
| + /** |
| + * The user principal name. |
| + */ |
| + username: { |
| + type: String, |
| + observer: 'usernameChanged_' |
| + }, |
| + }, |
| + |
| + /** @public */ |
| + reset: function() { |
| + this.$.animatedPages.selected = 0; |
| + this.$.oldPassword.value = ''; |
| + this.$.newPassword1.value = ''; |
| + this.$.newPassword2.value = ''; |
| + this.updateNavigation_(); |
| + }, |
| + |
| + /** @private */ |
| + usernameChanged_: function() { |
| + this.$.welcomeMessage.innerText = |
|
michaelpg
2017/01/11 22:09:13
this would be simpler as a computed binding that r
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
|
| + loadTimeData.getStringF('adPasswordChangeMessage', this.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 += 1; |
|
michaelpg
2017/01/11 22:09:12
nit: use ++
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
|
| + this.updateNavigation_(); |
| + var msg = { |
| + 'username': this.username, |
| + 'oldPassword': this.$.oldPassword.value, |
| + 'newPassword': this.$.newPassword1.value, |
| + 'repeatNewPassword': this.$.newPassword2.value, |
|
michaelpg
2017/01/11 22:09:12
redundant
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
|
| + }; |
| + 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); |
| + }, |
| +}); |