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

Unified Diff: chrome/browser/resources/options/password_manager_list.js

Issue 7274015: Keep the original index of password list items when filtering, so the right password can be deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
Index: chrome/browser/resources/options/password_manager_list.js
===================================================================
--- chrome/browser/resources/options/password_manager_list.js (revision 90611)
+++ chrome/browser/resources/options/password_manager_list.js (working copy)
@@ -10,7 +10,8 @@
/**
* Creates a new passwords list item.
- * @param {Array} entry An array of the form [url, username, password].
+ * @param {Array} entry An array of the form [url, username, password]. When
+ * the list has been filtered, a fourth element [index] may be present.
* @constructor
* @extends {cr.ui.ListItem}
*/
@@ -229,6 +230,11 @@
/** @inheritDoc */
deleteItemAtIndex: function(index) {
+ var item = this.dataModel.item(index);
+ if (item && item.length > 3) {
+ // The fourth element, if present, is the original index to delete.
+ index = item[3];
+ }
PasswordManager.removeSavedPassword(index);
},

Powered by Google App Engine
This is Rietveld 408576698