OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Populates default autofill profile from user's own Android contact. | 5 // Populates default autofill profile from user's own Android contact. |
6 #include "components/autofill/core/browser/android/auxiliary_profiles_android.h" | 6 #include "components/autofill/core/browser/android/auxiliary_profiles_android.h" |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Takes misc. address information strings from Android API and collapses | 38 // Takes misc. address information strings from Android API and collapses |
39 // into single string for "address line 2" | 39 // into single string for "address line 2" |
40 base::string16 CollapseAddress(const base::string16& post_office_box, | 40 base::string16 CollapseAddress(const base::string16& post_office_box, |
41 const base::string16& neighborhood) { | 41 const base::string16& neighborhood) { |
42 std::vector<base::string16> accumulator; | 42 std::vector<base::string16> accumulator; |
43 if (!post_office_box.empty()) | 43 if (!post_office_box.empty()) |
44 accumulator.push_back(post_office_box); | 44 accumulator.push_back(post_office_box); |
45 if (!neighborhood.empty()) | 45 if (!neighborhood.empty()) |
46 accumulator.push_back(neighborhood); | 46 accumulator.push_back(neighborhood); |
47 | 47 |
48 return JoinString(accumulator, ASCIIToUTF16(", ")); | 48 return JoinString(accumulator, base::ASCIIToUTF16(", ")); |
49 } | 49 } |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 namespace autofill { | 53 namespace autofill { |
54 | 54 |
55 AuxiliaryProfilesAndroid::AuxiliaryProfilesAndroid( | 55 AuxiliaryProfilesAndroid::AuxiliaryProfilesAndroid( |
56 const AuxiliaryProfileLoaderAndroid& profileLoader, | 56 const AuxiliaryProfileLoaderAndroid& profileLoader, |
57 const std::string& app_locale) | 57 const std::string& app_locale) |
58 : profile_loader_(profileLoader), | 58 : profile_loader_(profileLoader), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 profile->SetRawMultiInfo(EMAIL_ADDRESS, emails); | 113 profile->SetRawMultiInfo(EMAIL_ADDRESS, emails); |
114 } | 114 } |
115 | 115 |
116 void AuxiliaryProfilesAndroid::LoadPhoneNumbers(AutofillProfile* profile) { | 116 void AuxiliaryProfilesAndroid::LoadPhoneNumbers(AutofillProfile* profile) { |
117 std::vector<base::string16> phone_numbers; | 117 std::vector<base::string16> phone_numbers; |
118 profile_loader_.GetPhoneNumbers(&phone_numbers); | 118 profile_loader_.GetPhoneNumbers(&phone_numbers); |
119 profile->SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, phone_numbers); | 119 profile->SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, phone_numbers); |
120 } | 120 } |
121 | 121 |
122 } // namespace autofill | 122 } // namespace autofill |
OLD | NEW |