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

Unified Diff: chrome/browser/resources/gaia_auth/saml_injected.js

Issue 2065223002: Merge "Track password field id so it can be used to improve uniqueness of passwordId" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f79c62649293a13ab79900937ea9c284d611445d 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 || passwordField.name || '';
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,
@@ -174,9 +177,10 @@
* Handles 'change' event in the scraped password fields.
* @param {number} index The index of the password fields in
* |passwordFields_|.
+ * @param {string} fieldId The id or name of the password field or blank.
*/
- onPasswordChanged_: function(index) {
- this.maybeSendUpdatedPassword(index);
+ onPasswordChanged_: function(index, fieldId) {
+ this.maybeSendUpdatedPassword(index, fieldId);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698