Chromium Code Reviews| Index: chrome/browser/resources/gaia_auth/saml_injected.js |
| diff --git a/chrome/browser/resources/gaia_auth/saml_injected.js b/chrome/browser/resources/gaia_auth/saml_injected.js |
| index ae56f5cc537cce99829cb5b6cb8a1c892306fb11..a4279c6c2bfb11fcb027ca54a096b558a9d56488 100644 |
| --- a/chrome/browser/resources/gaia_auth/saml_injected.js |
| +++ b/chrome/browser/resources/gaia_auth/saml_injected.js |
| @@ -143,8 +143,9 @@ |
| return; |
| var index = this.passwordFields_.length; |
| + var fieldId = passwordField.id; |
|
xiyuan
2016/06/10 17:05:58
It is possible that the IdP page does not set "id"
|
| passwordField.addEventListener( |
| - 'input', this.onPasswordChanged_.bind(this, index)); |
| + 'input', this.onPasswordChanged_.bind(this, index, fieldId)); |
| this.passwordFields_.push(passwordField); |
| this.passwordValues_.push(passwordField.value); |
| }, |
| @@ -153,16 +154,18 @@ |
| * Check if the password field at |index| has changed. If so, sends back |
| * the updated value. |
| */ |
| - maybeSendUpdatedPassword: function(index) { |
| + maybeSendUpdatedPassword: function(index, fieldId) { |
| var newValue = this.passwordFields_[index].value; |
| if (newValue == this.passwordValues_[index]) |
| return; |
| this.passwordValues_[index] = newValue; |
| - // Use an invalid char for URL as delimiter to concatenate page url and |
| - // password field index to construct a unique ID for the password field. |
| - var passwordId = this.pageURL_.split('#')[0].split('?')[0] + '|' + index; |
| + // Use an invalid char for URL as delimiter to concatenate page url, |
| + // password field index and id to construct a unique ID for the password |
| + // field. |
| + var passwordId = this.pageURL_.split('#')[0].split('?')[0] + |
| + '|' + index + '|' + fieldId; |
| this.channel_.send({ |
| name: 'updatePassword', |
| id: passwordId, |
| @@ -175,8 +178,8 @@ |
| * @param {number} index The index of the password fields in |
| * |passwordFields_|. |
|
xiyuan
2016/06/10 17:05:59
Document fieldId?
|
| */ |
| - onPasswordChanged_: function(index) { |
| - this.maybeSendUpdatedPassword(index); |
| + onPasswordChanged_: function(index, fieldId) { |
| + this.maybeSendUpdatedPassword(index, fieldId); |
| } |
| }; |