| 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_AUTOFILL_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 15 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 16 | 16 |
| 17 class AutofillEntry; | 17 class AutofillEntry; |
| 18 class AutofillKey; | 18 class AutofillKey; |
| 19 class AutofillProfile; | 19 class AutofillProfile; |
| 20 class AutofillType; | 20 class AutofillType; |
| 21 class CreditCard; |
| 21 class PersonalDataManager; | 22 class PersonalDataManager; |
| 22 class WebDataService; | 23 class WebDataService; |
| 23 | 24 |
| 24 namespace autofill_helper { | 25 namespace autofill_helper { |
| 25 | 26 |
| 26 enum ProfileType { | 27 enum ProfileType { |
| 27 PROFILE_MARION, | 28 PROFILE_MARION, |
| 28 PROFILE_HOMER, | 29 PROFILE_HOMER, |
| 29 PROFILE_FRASIER, | 30 PROFILE_FRASIER, |
| 30 PROFILE_NULL | 31 PROFILE_NULL |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 std::set<AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT; | 52 std::set<AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT; |
| 52 | 53 |
| 53 // Compares the form fields in the WebDataServices of sync profiles | 54 // Compares the form fields in the WebDataServices of sync profiles |
| 54 // |profile_a| and |profile_b|. Returns true if they match. | 55 // |profile_a| and |profile_b|. Returns true if they match. |
| 55 bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; | 56 bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; |
| 56 | 57 |
| 57 // Replaces the Autofill profiles in sync profile |profile| with | 58 // Replaces the Autofill profiles in sync profile |profile| with |
| 58 // |autofill_profiles|. | 59 // |autofill_profiles|. |
| 59 void SetProfiles(int profile, std::vector<AutofillProfile>* autofill_profiles); | 60 void SetProfiles(int profile, std::vector<AutofillProfile>* autofill_profiles); |
| 60 | 61 |
| 62 // Replaces the CreditCard profiles in sync profile |profile| with |
| 63 // |credit_cards|. |
| 64 void SetCreditCards(int profile, std::vector<CreditCard>* credit_cards); |
| 65 |
| 61 // Adds the autofill profile |autofill_profile| to sync profile |profile|. | 66 // Adds the autofill profile |autofill_profile| to sync profile |profile|. |
| 62 void AddProfile(int profile, const AutofillProfile& autofill_profile); | 67 void AddProfile(int profile, const AutofillProfile& autofill_profile); |
| 63 | 68 |
| 64 // Removes the autofill profile with guid |guid| from sync profile | 69 // Removes the autofill profile with guid |guid| from sync profile |
| 65 // |profile|. | 70 // |profile|. |
| 66 void RemoveProfile(int profile, const std::string& guid); | 71 void RemoveProfile(int profile, const std::string& guid); |
| 67 | 72 |
| 68 // Updates the autofill profile with guid |guid| in sync profile |profile| | 73 // Updates the autofill profile with guid |guid| in sync profile |profile| |
| 69 // to |type| and |value|. | 74 // to |type| and |value|. |
| 70 void UpdateProfile(int profile, | 75 void UpdateProfile(int profile, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 91 // Compares the autofill profiles for all sync profiles, and returns true if | 96 // Compares the autofill profiles for all sync profiles, and returns true if |
| 92 // they all match. | 97 // they all match. |
| 93 bool AllProfilesMatch() WARN_UNUSED_RESULT; | 98 bool AllProfilesMatch() WARN_UNUSED_RESULT; |
| 94 | 99 |
| 95 // Creates a test autofill profile based on the persona specified in |type|. | 100 // Creates a test autofill profile based on the persona specified in |type|. |
| 96 AutofillProfile CreateAutofillProfile(ProfileType type); | 101 AutofillProfile CreateAutofillProfile(ProfileType type); |
| 97 | 102 |
| 98 } // namespace autofill_helper | 103 } // namespace autofill_helper |
| 99 | 104 |
| 100 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ | 105 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
| OLD | NEW |