OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/autofill/autofill_common_test.h" | 5 #include "chrome/browser/autofill/autofill_common_test.h" |
6 | 6 |
7 #include "base/prefs/public/pref_service_base.h" | 7 #include "base/prefs/public/pref_service_base.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/autofill_profile.h" | 9 #include "chrome/browser/autofill/autofill_profile.h" |
10 #include "chrome/browser/autofill/credit_card.h" | 10 #include "chrome/browser/autofill/credit_card.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 FormFieldData* field) { | 22 FormFieldData* field) { |
23 field->label = ASCIIToUTF16(label); | 23 field->label = ASCIIToUTF16(label); |
24 field->name = ASCIIToUTF16(name); | 24 field->name = ASCIIToUTF16(name); |
25 field->value = ASCIIToUTF16(value); | 25 field->value = ASCIIToUTF16(value); |
26 field->form_control_type = type; | 26 field->form_control_type = type; |
27 } | 27 } |
28 | 28 |
29 inline void check_and_set( | 29 inline void check_and_set( |
30 FormGroup* profile, AutofillFieldType type, const char* value) { | 30 FormGroup* profile, AutofillFieldType type, const char* value) { |
31 if (value) | 31 if (value) |
32 profile->SetInfo(type, UTF8ToUTF16(value)); | 32 profile->SetRawInfo(type, UTF8ToUTF16(value)); |
33 } | 33 } |
34 | 34 |
35 void SetProfileInfo(AutofillProfile* profile, | 35 void SetProfileInfo(AutofillProfile* profile, |
36 const char* first_name, const char* middle_name, | 36 const char* first_name, const char* middle_name, |
37 const char* last_name, const char* email, const char* company, | 37 const char* last_name, const char* email, const char* company, |
38 const char* address1, const char* address2, const char* city, | 38 const char* address1, const char* address2, const char* city, |
39 const char* state, const char* zipcode, const char* country, | 39 const char* state, const char* zipcode, const char* country, |
40 const char* phone) { | 40 const char* phone) { |
41 check_and_set(profile, NAME_FIRST, first_name); | 41 check_and_set(profile, NAME_FIRST, first_name); |
42 check_and_set(profile, NAME_MIDDLE, middle_name); | 42 check_and_set(profile, NAME_MIDDLE, middle_name); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Disable auxiliary profiles for unit testing. These reach out to system | 83 // Disable auxiliary profiles for unit testing. These reach out to system |
84 // services on the Mac. | 84 // services on the Mac. |
85 if (profile) { | 85 if (profile) { |
86 PrefServiceBase::FromBrowserContext(profile)->SetBoolean( | 86 PrefServiceBase::FromBrowserContext(profile)->SetBoolean( |
87 prefs::kAutofillAuxiliaryProfilesEnabled, false); | 87 prefs::kAutofillAuxiliaryProfilesEnabled, false); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 } // namespace autofill_test | 91 } // namespace autofill_test |
OLD | NEW |