Index: chrome/browser/resources/options/password_manager.js |
=================================================================== |
--- chrome/browser/resources/options/password_manager.js (revision 90611) |
+++ chrome/browser/resources/options/password_manager.js (working copy) |
@@ -153,9 +153,15 @@ |
// Implement password searching here in javascript, rather than in C++. |
// The number of saved passwords shouldn't be too big for us to handle. |
var query = this.lastQuery_; |
- var filter = function(entry) { |
+ var filter = function(entry, index, list) { |
James Hawkins
2011/06/28 01:27:18
|list| is unused?
Mike Mammarella
2011/06/28 01:30:27
Correct, but it's apparently passed so I included
James Hawkins
2011/06/28 01:31:22
Can't we not include it, like we did before?
Mike Mammarella
2011/06/28 01:34:19
We could, but I almost rewrote this by hand just b
|
// Search both URL and username. |
- return entry[0].indexOf(query) >= 0 || entry[1].indexOf(query) >= 0; |
+ if (entry[0].indexOf(query) >= 0 || entry[1].indexOf(query) >= 0) { |
+ // Keep the original index so we can delete correctly. See also |
+ // deleteItemAtIndex() in password_manager_list.js that uses this. |
+ entry[3] = index; |
+ return true; |
+ } |
+ return false; |
}; |
entries = entries.filter(filter); |
} |