OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
12 #include "chrome/browser/sync/test/integration/sync_test.h" | 12 #include "chrome/browser/sync/test/integration/sync_test.h" |
13 #include "content/public/common/password_form.h" | 13 #include "components/autofill/core/common/password_form.h" |
14 | 14 |
15 class PasswordStore; | 15 class PasswordStore; |
16 | 16 |
17 namespace passwords_helper { | 17 namespace passwords_helper { |
18 | 18 |
19 // Adds the login held in |form| to the password store |store|. Even though | 19 // Adds the login held in |form| to the password store |store|. Even though |
20 // logins are normally added asynchronously, this method will block until the | 20 // logins are normally added asynchronously, this method will block until the |
21 // login is added. | 21 // login is added. |
22 void AddLogin(PasswordStore* store, const content::PasswordForm& form); | 22 void AddLogin(PasswordStore* store, const autofill::PasswordForm& form); |
23 | 23 |
24 // Update the data held in password store |store| with a modified |form|. | 24 // Update the data held in password store |store| with a modified |form|. |
25 // This method blocks until the operation is complete. | 25 // This method blocks until the operation is complete. |
26 void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); | 26 void UpdateLogin(PasswordStore* store, const autofill::PasswordForm& form); |
27 | 27 |
28 // Searches |store| for all logins matching a fake signon realm used only by | 28 // Searches |store| for all logins matching a fake signon realm used only by |
29 // LivePasswordsSyncTest and adds the results to |matches|. Note that the | 29 // LivePasswordsSyncTest and adds the results to |matches|. Note that the |
30 // caller is responsible for deleting the forms added to |matches|. | 30 // caller is responsible for deleting the forms added to |matches|. |
31 void GetLogins(PasswordStore* store, | 31 void GetLogins(PasswordStore* store, |
32 std::vector<content::PasswordForm>& matches); | 32 std::vector<autofill::PasswordForm>& matches); |
33 | 33 |
34 // Removes the login held in |form| from the password store |store|. This | 34 // Removes the login held in |form| from the password store |store|. This |
35 // method blocks until the operation is complete. | 35 // method blocks until the operation is complete. |
36 void RemoveLogin(PasswordStore* store, const content::PasswordForm& form); | 36 void RemoveLogin(PasswordStore* store, const autofill::PasswordForm& form); |
37 | 37 |
38 // Removes all password forms from the password store |store|. | 38 // Removes all password forms from the password store |store|. |
39 void RemoveLogins(PasswordStore* store); | 39 void RemoveLogins(PasswordStore* store); |
40 | 40 |
41 // Sets the cryptographer's encryption passphrase for the profile at index | 41 // Sets the cryptographer's encryption passphrase for the profile at index |
42 // |index| to |passphrase|, and passphrase type |type|. | 42 // |index| to |passphrase|, and passphrase type |type|. |
43 void SetEncryptionPassphrase(int index, | 43 void SetEncryptionPassphrase(int index, |
44 const std::string& passphrase, | 44 const std::string& passphrase, |
45 ProfileSyncService::PassphraseType type); | 45 ProfileSyncService::PassphraseType type); |
46 | 46 |
(...skipping 25 matching lines...) Expand all Loading... |
72 | 72 |
73 // Returns the number of forms in the password store of the profile with index | 73 // Returns the number of forms in the password store of the profile with index |
74 // |index|. | 74 // |index|. |
75 int GetPasswordCount(int index); | 75 int GetPasswordCount(int index); |
76 | 76 |
77 // Returns the number of forms in the password store of the verifier profile. | 77 // Returns the number of forms in the password store of the verifier profile. |
78 int GetVerifierPasswordCount(); | 78 int GetVerifierPasswordCount(); |
79 | 79 |
80 // Creates a test password form with a well known fake signon realm used only | 80 // Creates a test password form with a well known fake signon realm used only |
81 // by LivePasswordsSyncTest based on |index|. | 81 // by LivePasswordsSyncTest based on |index|. |
82 content::PasswordForm CreateTestPasswordForm(int index); | 82 autofill::PasswordForm CreateTestPasswordForm(int index); |
83 | 83 |
84 } // namespace passwords_helper | 84 } // namespace passwords_helper |
85 | 85 |
86 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ | 86 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ |
OLD | NEW |