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

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: Removed import-complete dialog. 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 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/scoped_vector.h" 15 #include "base/memory/scoped_vector.h"
16 #include "components/password_manager/core/browser/password_store.h" 16 #include "components/password_manager/core/browser/password_store.h"
17 #include "components/password_manager/core/browser/password_store_consumer.h" 17 #include "components/password_manager/core/browser/password_store_consumer.h"
18 #include "components/prefs/pref_member.h" 18 #include "components/prefs/pref_member.h"
19 #include "ui/shell_dialogs/select_file_dialog.h"
19 20
20 namespace autofill { 21 namespace autofill {
21 struct PasswordForm; 22 struct PasswordForm;
22 } 23 }
23 24
24 class PasswordUIView; 25 class PasswordUIView;
25 26
26 class Profile; 27 class Profile;
27 28
28 // Contains the common logic used by a PasswordUIView to 29 // Contains the common logic used by a PasswordUIView to
(...skipping 11 matching lines...) Expand all
40 const password_manager::PasswordStoreChangeList& changes) override; 41 const password_manager::PasswordStoreChangeList& changes) override;
41 42
42 // Repopulates the password and exception entries. 43 // Repopulates the password and exception entries.
43 void UpdatePasswordLists(); 44 void UpdatePasswordLists();
44 45
45 void Initialize(); 46 void Initialize();
46 47
47 // Gets the password entry at |index|. 48 // Gets the password entry at |index|.
48 const autofill::PasswordForm* GetPassword(size_t index); 49 const autofill::PasswordForm* GetPassword(size_t index);
49 50
51 // Returns the password store associated with the currently active profile.
52 password_manager::PasswordStore* GetPasswordStore();
53
54 // Gets all password entries.
55 std::vector<scoped_ptr<autofill::PasswordForm>> GetAllPasswords();
56
50 // Gets the password exception entry at |index|. 57 // Gets the password exception entry at |index|.
51 const autofill::PasswordForm* GetPasswordException(size_t index); 58 const autofill::PasswordForm* GetPasswordException(size_t index);
52 59
53 // Removes the saved password entry at |index|. 60 // Removes the saved password entry at |index|.
54 // |index| the entry index to be removed. 61 // |index| the entry index to be removed.
55 void RemoveSavedPassword(size_t index); 62 void RemoveSavedPassword(size_t index);
56 63
57 // Removes the saved password exception entry at |index|. 64 // Removes the saved password exception entry at |index|.
58 // |index| the entry index to be removed. 65 // |index| the entry index to be removed.
59 void RemovePasswordException(size_t index); 66 void RemovePasswordException(size_t index);
60 67
61 // Requests the plain text password for entry at |index| to be revealed. 68 // Requests the plain text password for entry at |index| to be revealed.
62 // |index| The index of the entry. 69 // |index| The index of the entry.
63 void RequestShowPassword(size_t index); 70 void RequestShowPassword(size_t index);
64 71
72 // Returns true if the user is authenticated.
73 virtual bool IsUserAuthenticated();
74
65 private: 75 private:
66 friend class PasswordManagerPresenterTest; 76 friend class PasswordManagerPresenterTest;
67 77
68 // Returns the password store associated with the currently active profile. 78 // Returns true if the user needs to be authenticated before a plaintext
69 password_manager::PasswordStore* GetPasswordStore(); 79 // password is revealed or exported.
80 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