| Index: chrome/browser/resources/options/password_manager.js
|
| diff --git a/chrome/browser/resources/options/password_manager.js b/chrome/browser/resources/options/password_manager.js
|
| index a62c5960fd4f69b0172a0a4b5542ff69799c5ce3..3e501727ff7b904a63df1d7a3843d10c35f21985 100644
|
| --- a/chrome/browser/resources/options/password_manager.js
|
| +++ b/chrome/browser/resources/options/password_manager.js
|
| @@ -175,12 +175,14 @@ cr.define('options', function() {
|
| // The number of saved passwords shouldn't be too big for us to handle.
|
| var query = this.lastQuery_;
|
| var filter = function(entry, index, list) {
|
| - // Search both URL and username.
|
| - if (entry[0].toLowerCase().indexOf(query.toLowerCase()) >= 0 ||
|
| - entry[1].toLowerCase().indexOf(query.toLowerCase()) >= 0) {
|
| + // Search both shown URL and username.
|
| + var shownUrl = entry[options.passwordManager.SHOWN_URL_FIELD];
|
| + var username = entry[options.passwordManager.USERNAME_FIELD];
|
| + if (shownUrl.toLowerCase().indexOf(query.toLowerCase()) >= 0 ||
|
| + username.toLowerCase().indexOf(query.toLowerCase()) >= 0) {
|
| // Keep the original index so we can delete correctly. See also
|
| // deleteItemAtIndex() in password_manager_list.js that uses this.
|
| - entry[4] = index;
|
| + entry[options.passwordManager.ORIGINAL_INDEX_FIELD] = index;
|
| return true;
|
| }
|
| return false;
|
| @@ -214,7 +216,8 @@ cr.define('options', function() {
|
| // index in the model, but each entry stores its original index, so
|
| // we can find the item using a linear search.
|
| for (var i = 0; i < model.length; ++i) {
|
| - if (model.item(i)[4] == index) {
|
| + if (model.item(i)[options.passwordManager.ORIGINAL_INDEX_FIELD] ==
|
| + index) {
|
| index = i;
|
| break;
|
| }
|
|
|