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

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: Mistype in a comment 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
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/password_manager_presenter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f8a8b7e798a86945ec95fe457ea01a180576b00d 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 password are also included in sort key. If there are 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_;
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/password_manager_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698