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

Side by Side Diff: chrome/browser/autofill/autofill_common_test.cc

Issue 6673079: Reduce boxing and unboxing of AutofillFieldType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/address_unittest.cc ('k') | chrome/browser/autofill/autofill_field.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autofill/autofill_profile.h" 8 #include "chrome/browser/autofill/autofill_profile.h"
9 #include "chrome/browser/autofill/credit_card.h" 9 #include "chrome/browser/autofill/credit_card.h"
10 #include "chrome/browser/password_manager/encryptor.h" 10 #include "chrome/browser/password_manager/encryptor.h"
(...skipping 10 matching lines...) Expand all
21 const char* type, 21 const char* type,
22 webkit_glue::FormField* field) { 22 webkit_glue::FormField* field) {
23 *field = webkit_glue::FormField(ASCIIToUTF16(label), ASCIIToUTF16(name), 23 *field = webkit_glue::FormField(ASCIIToUTF16(label), ASCIIToUTF16(name),
24 ASCIIToUTF16(value), ASCIIToUTF16(type), 0, 24 ASCIIToUTF16(value), ASCIIToUTF16(type), 0,
25 false); 25 false);
26 } 26 }
27 27
28 inline void check_and_set( 28 inline void check_and_set(
29 FormGroup* profile, AutofillFieldType type, const char* value) { 29 FormGroup* profile, AutofillFieldType type, const char* value) {
30 if (value) 30 if (value)
31 profile->SetInfo(AutofillType(type), ASCIIToUTF16(value)); 31 profile->SetInfo(type, ASCIIToUTF16(value));
32 } 32 }
33 33
34 void SetProfileInfo(AutofillProfile* profile, 34 void SetProfileInfo(AutofillProfile* profile,
35 const char* first_name, const char* middle_name, 35 const char* first_name, const char* middle_name,
36 const char* last_name, const char* email, const char* company, 36 const char* last_name, const char* email, const char* company,
37 const char* address1, const char* address2, const char* city, 37 const char* address1, const char* address2, const char* city,
38 const char* state, const char* zipcode, const char* country, 38 const char* state, const char* zipcode, const char* country,
39 const char* phone, const char* fax) { 39 const char* phone, const char* fax) {
40 check_and_set(profile, NAME_FIRST, first_name); 40 check_and_set(profile, NAME_FIRST, first_name);
41 check_and_set(profile, NAME_MIDDLE, middle_name); 41 check_and_set(profile, NAME_MIDDLE, middle_name);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 profile->GetPrefs()->SetBoolean(prefs::kAutoFillAuxiliaryProfilesEnabled, 86 profile->GetPrefs()->SetBoolean(prefs::kAutoFillAuxiliaryProfilesEnabled,
87 false); 87 false);
88 } 88 }
89 } 89 }
90 90
91 } // namespace autofill_test 91 } // namespace autofill_test
OLDNEW
« no previous file with comments | « chrome/browser/autofill/address_unittest.cc ('k') | chrome/browser/autofill/autofill_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698