| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Polymer element for displaying AD domain joining and AD | 6 * @fileoverview Polymer element for displaying AD domain joining and AD |
| 7 * Authenticate user screens. | 7 * Authenticate user screens. |
| 8 */ | 8 */ |
| 9 // Possible error states of the screen. Must be in the same order as | 9 // Possible error states of the screen. Must be in the same order as |
| 10 // ActiveDirectoryErrorState enum values. | 10 // ActiveDirectoryErrorState enum values. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } else { | 77 } else { |
| 78 this.$.passwordInput.focus(); | 78 this.$.passwordInput.focus(); |
| 79 } | 79 } |
| 80 }, | 80 }, |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * @param {string|undefined} user | 83 * @param {string|undefined} user |
| 84 * @param {string|undefined} machineName | 84 * @param {string|undefined} machineName |
| 85 */ | 85 */ |
| 86 setUser: function(user, machineName) { | 86 setUser: function(user, machineName) { |
| 87 if (this.userRealm && user) |
| 88 user = user.replace(this.userRealm, ''); |
| 87 this.$.userInput.value = user || ''; | 89 this.$.userInput.value = user || ''; |
| 88 this.$.machineNameInput.value = machineName || ''; | 90 this.$.machineNameInput.value = machineName || ''; |
| 89 this.$.passwordInput.value = ''; | 91 this.$.passwordInput.value = ''; |
| 90 this.focus(); | 92 this.focus(); |
| 91 }, | 93 }, |
| 92 | 94 |
| 93 setInvalid: function(value) { | 95 setInvalid: function(value) { |
| 94 this.$.machineNameInput.isInvalid = false; | 96 this.$.machineNameInput.isInvalid = false; |
| 95 this.$.userInput.isInvalid = false; | 97 this.$.userInput.isInvalid = false; |
| 96 this.$.passwordInput.isInvalid = false; | 98 this.$.passwordInput.isInvalid = false; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 127 user += this.userRealm; | 129 user += this.userRealm; |
| 128 var msg = { | 130 var msg = { |
| 129 'machinename': this.$.machineNameInput.value, | 131 'machinename': this.$.machineNameInput.value, |
| 130 'username': user, | 132 'username': user, |
| 131 'password': this.$.passwordInput.value | 133 'password': this.$.passwordInput.value |
| 132 }; | 134 }; |
| 133 this.$.passwordInput.value = ''; | 135 this.$.passwordInput.value = ''; |
| 134 this.fire('authCompleted', msg); | 136 this.fire('authCompleted', msg); |
| 135 }, | 137 }, |
| 136 }); | 138 }); |
| OLD | NEW |