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