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

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

Issue 1193143003: Enable import/export of passwords into/from Password Manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 5 years, 5 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
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 25 matching lines...) Expand all
36 const password_manager::PasswordStoreChangeList& changes) override; 36 const password_manager::PasswordStoreChangeList& changes) override;
37 37
38 // Repopulates the password and exception entries. 38 // Repopulates the password and exception entries.
39 void UpdatePasswordLists(); 39 void UpdatePasswordLists();
40 40
41 void Initialize(); 41 void Initialize();
42 42
43 // Gets the password entry at |index|. 43 // Gets the password entry at |index|.
44 const autofill::PasswordForm* GetPassword(size_t index); 44 const autofill::PasswordForm* GetPassword(size_t index);
45 45
46 // Gets all password entries.
47 ScopedVector<autofill::PasswordForm> GetAllPasswords();
48
46 // Gets the password exception entry at |index|. 49 // Gets the password exception entry at |index|.
47 const autofill::PasswordForm* GetPasswordException(size_t index); 50 const autofill::PasswordForm* GetPasswordException(size_t index);
48 51
52 // Returns the password store associated with the currently active profile.
53 password_manager::PasswordStore* GetPasswordStore();
54
49 // Removes the saved password entry at |index|. 55 // Removes the saved password entry at |index|.
50 // |index| the entry index to be removed. 56 // |index| the entry index to be removed.
51 void RemoveSavedPassword(size_t index); 57 void RemoveSavedPassword(size_t index);
52 58
53 // Removes the saved password exception entry at |index|. 59 // Removes the saved password exception entry at |index|.
54 // |index| the entry index to be removed. 60 // |index| the entry index to be removed.
55 void RemovePasswordException(size_t index); 61 void RemovePasswordException(size_t index);
56 62
57 // Requests the plain text password for entry at |index| to be revealed. 63 // Requests the plain text password for entry at |index| to be revealed.
58 // |index| The index of the entry. 64 // |index| The index of the entry.
59 void RequestShowPassword(size_t index); 65 void RequestShowPassword(size_t index);
60 66
67 // Request to have all password entries exported. The request will be granted
68 // based on the outcome of OS-level re-authentication.
69 // Return true if request is granted.
70 virtual bool RequestToExportPassword();
71
61 private: 72 private:
62 friend class PasswordManagerPresenterTest; 73 friend class PasswordManagerPresenterTest;
63 74
64 // Returns the password store associated with the currently active profile. 75 // Returns true if the user needs to be authenticated before a plaintext
65 password_manager::PasswordStore* GetPasswordStore(); 76 // password is revealed or exported.
77 bool IsAuthenticationRequired();
66 78
67 // Returns true if the user needs to be authenticated before a plaintext 79 // Returns true if the user is authenticated
vabr (Chromium) 2015/07/07 12:58:06 nit: Missing a full-stop at the end.
xunlu 2015/07/07 18:42:47 Done.
68 // password is revealed. 80 bool IsUserAuthenticated();
69 bool IsAuthenticationRequired();
70 81
71 // Sets the password and exception list of the UI view. 82 // Sets the password and exception list of the UI view.
72 void SetPasswordList(); 83 void SetPasswordList();
73 void SetPasswordExceptionList(); 84 void SetPasswordExceptionList();
74 85
75 // A short class to mediate requests to the password store. 86 // A short class to mediate requests to the password store.
76 class ListPopulater : public password_manager::PasswordStoreConsumer { 87 class ListPopulater : public password_manager::PasswordStoreConsumer {
77 public: 88 public:
78 explicit ListPopulater(PasswordManagerPresenter* page); 89 explicit ListPopulater(PasswordManagerPresenter* page);
79 ~ListPopulater() override; 90 ~ListPopulater() override;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // UI view that owns this presenter. 143 // UI view that owns this presenter.
133 PasswordUIView* password_view_; 144 PasswordUIView* password_view_;
134 145
135 // User pref for storing accept languages. 146 // User pref for storing accept languages.
136 std::string languages_; 147 std::string languages_;
137 148
138 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); 149 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter);
139 }; 150 };
140 151
141 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ 152 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698