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

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

Issue 1318523011: [Password Manager] Copiable username and origin. Linkable origin elided from the left. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes with StringPiece Created 5 years, 2 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 | chrome/browser/resources/options/password_manager_list.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | chrome/browser/resources/options/password_manager_list.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698