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

Side by Side Diff: chrome/browser/ui/passwords/password_manager_presenter.h

Issue 1936053002: [Password Manager] Add federations to sort key on password page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/password_manager_presenter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
17 #include "components/password_manager/core/browser/password_store.h" 17 #include "components/password_manager/core/browser/password_store.h"
18 #include "components/password_manager/core/browser/password_store_consumer.h" 18 #include "components/password_manager/core/browser/password_store_consumer.h"
19 #include "components/prefs/pref_member.h" 19 #include "components/prefs/pref_member.h"
20 20
21 namespace autofill { 21 namespace autofill {
22 struct PasswordForm; 22 struct PasswordForm;
23 } 23 }
24 24
25 // Multimap from sort key to password forms. 25 // Multimap from sort key to password forms.
26 using DuplicatesMap = 26 using DuplicatesMap =
27 std::multimap<std::string, std::unique_ptr<autofill::PasswordForm>>; 27 std::multimap<std::string, std::unique_ptr<autofill::PasswordForm>>;
28 28
29 enum class PasswordEntryType { SAVED, BLACKLISTED };
30
29 class PasswordUIView; 31 class PasswordUIView;
30 32
31 class Profile; 33 class Profile;
32 34
33 // Contains the common logic used by a PasswordUIView to 35 // Contains the common logic used by a PasswordUIView to
34 // interact with PasswordStore. It provides completion callbacks for 36 // interact with PasswordStore. It provides completion callbacks for
35 // PasswordStore operations and updates the view on PasswordStore changes. 37 // PasswordStore operations and updates the view on PasswordStore changes.
36 class PasswordManagerPresenter 38 class PasswordManagerPresenter
37 : public password_manager::PasswordStore::Observer { 39 : public password_manager::PasswordStore::Observer {
38 public: 40 public:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 74
73 // Returns the password store associated with the currently active profile. 75 // Returns the password store associated with the currently active profile.
74 password_manager::PasswordStore* GetPasswordStore(); 76 password_manager::PasswordStore* GetPasswordStore();
75 77
76 // Sets the password and exception list of the UI view. 78 // Sets the password and exception list of the UI view.
77 void SetPasswordList(); 79 void SetPasswordList();
78 void SetPasswordExceptionList(); 80 void SetPasswordExceptionList();
79 81
80 // Sort entries of |list| based on sort key. The key is the concatenation of 82 // Sort entries of |list| based on sort key. The key is the concatenation of
81 // origin, entry type (non-Android credential, Android w/ affiliated web realm 83 // origin, entry type (non-Android credential, Android w/ affiliated web realm
82 // or Android w/o affiliated web realm). If |username_and_password_in_key|, 84 // or Android w/o affiliated web realm). If |entry_type == SAVED|,
83 // username and password are also included in sort key. If there are several 85 // username, password and federation are also included in sort key. If there
84 // forms with the same key, all such forms but the first one are 86 // are several forms with the same key, all such forms but the first one are
85 // stored in |duplicates| instead of |list|. 87 // stored in |duplicates| instead of |list|.
86 void SortEntriesAndHideDuplicates( 88 void SortEntriesAndHideDuplicates(
87 std::vector<std::unique_ptr<autofill::PasswordForm>>* list, 89 std::vector<std::unique_ptr<autofill::PasswordForm>>* list,
88 DuplicatesMap* duplicates, 90 DuplicatesMap* duplicates,
89 bool username_and_password_in_key); 91 PasswordEntryType entry_type);
90 92
91 // A short class to mediate requests to the password store. 93 // A short class to mediate requests to the password store.
92 class ListPopulater : public password_manager::PasswordStoreConsumer { 94 class ListPopulater : public password_manager::PasswordStoreConsumer {
93 public: 95 public:
94 explicit ListPopulater(PasswordManagerPresenter* page); 96 explicit ListPopulater(PasswordManagerPresenter* page);
95 ~ListPopulater() override; 97 ~ListPopulater() override;
96 98
97 // Send a query to the password store to populate a list. 99 // Send a query to the password store to populate a list.
98 virtual void Populate() = 0; 100 virtual void Populate() = 0;
99 101
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Used to determine whether or not to reveal plaintext passwords. 142 // Used to determine whether or not to reveal plaintext passwords.
141 base::TimeTicks last_authentication_time_; 143 base::TimeTicks last_authentication_time_;
142 144
143 // UI view that owns this presenter. 145 // UI view that owns this presenter.
144 PasswordUIView* password_view_; 146 PasswordUIView* password_view_;
145 147
146 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); 148 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter);
147 }; 149 };
148 150
149 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ 151 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_
OLDNEW
« 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