Chromium Code Reviews| 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 6e16ebac5e14d48e2cba966de98e8638f585fa26..7dad728a1b02f2056c6f75e2dd3ee4a309a15bff 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_DATA_INDEX]; |
| + var username = entry[options.passwordManager.USERNAME_DATA_INDEX]; |
| + 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_DATA_INDEX] = 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_DATA_INDEX] == |
|
Evan Stade
2015/10/05 18:59:41
The item should be changed to a dict (js object) a
kolos1
2015/10/06 18:52:32
Done.
|
| + index) { |
| index = i; |
| break; |
| } |