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

Unified Diff: chrome/browser/ui/passwords/password_manager_presenter.h

Issue 1589483002: [Password Manager] Implements entries sorting and duplicates omitting on chrome://settings/passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use non-hashed passwords, StringPiece in SplitByDotAndReverse Created 4 years, 9 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/ui/passwords/password_manager_presenter.h
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.h b/chrome/browser/ui/passwords/password_manager_presenter.h
index 0096cdf25eb16d730d1b4ca4c0c4fa0272d23dc7..c674b6829620cb6f71c4b0699ee4c5306aed8a0a 100644
--- a/chrome/browser/ui/passwords/password_manager_presenter.h
+++ b/chrome/browser/ui/passwords/password_manager_presenter.h
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <map>
#include <string>
#include <vector>
@@ -21,6 +22,10 @@ namespace autofill {
struct PasswordForm;
}
+// Multimap from sort key to password forms.
+using DuplicatesMap =
+ std::multimap<std::string, scoped_ptr<autofill::PasswordForm>>;
+
class PasswordUIView;
class Profile;
@@ -72,6 +77,18 @@ class PasswordManagerPresenter
void SetPasswordList();
void SetPasswordExceptionList();
+ // Sort entries of |list| based on sort key. The key is the concatenation of
+ // origin, entry type (non-Android credential, Android w/ affiliated web realm
+ // or Android w/o affiliated web realm). If |username_and_password_in_key|,
+ // username and hashed password are also included in sort key. If there is
vabr (Chromium) 2016/03/09 10:00:11 Please update the comment to not mention hashing a
kolos1 2016/03/09 13:34:55 Done.
+ // several forms with the same key, all such forms but the first one are
+ // stored in |duplicates| instead of |list|.
+ void SortEntriesAndHideDuplicates(
+ const std::string& languages,
+ std::vector<scoped_ptr<autofill::PasswordForm>>* list,
+ DuplicatesMap* duplicates,
+ bool username_and_password_in_key);
+
// A short class to mediate requests to the password store.
class ListPopulater : public password_manager::PasswordStoreConsumer {
public:
@@ -117,6 +134,8 @@ class PasswordManagerPresenter
std::vector<scoped_ptr<autofill::PasswordForm>> password_list_;
std::vector<scoped_ptr<autofill::PasswordForm>> password_exception_list_;
+ DuplicatesMap password_duplicates_;
+ DuplicatesMap password_exception_duplicates_;
// Whether to show stored passwords or not.
BooleanPrefMember show_passwords_;

Powered by Google App Engine
This is Rietveld 408576698