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/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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "components/autofill/browser/android/auxiliary_profile_loader_android.h
" | 17 #include "components/autofill/core/browser/android/auxiliary_profile_loader_andr
oid.h" |
18 #include "components/autofill/browser/autofill_profile.h" | 18 #include "components/autofill/core/browser/autofill_profile.h" |
19 #include "components/autofill/browser/phone_number.h" | 19 #include "components/autofill/core/browser/phone_number.h" |
20 | 20 |
21 // Generates the autofill profile by accessing the Android | 21 // Generates the autofill profile by accessing the Android |
22 // ContactsContract.Profile API through PersonalAutofillPopulator via JNI. | 22 // ContactsContract.Profile API through PersonalAutofillPopulator via JNI. |
23 // The generated profile corresponds to the user's "ME" contact in the | 23 // The generated profile corresponds to the user's "ME" contact in the |
24 // "People" app. The caller passes a vector of profiles into the constructor | 24 // "People" app. The caller passes a vector of profiles into the constructor |
25 // then initiates a fetch using |GetContactsProfile()| method. This clears | 25 // then initiates a fetch using |GetContactsProfile()| method. This clears |
26 // any existing addresses. | 26 // any existing addresses. |
27 | 27 |
28 // Randomly generated guid. The Autofillprofile class requires a consistent | 28 // Randomly generated guid. The Autofillprofile class requires a consistent |
29 // unique guid or else things break. | 29 // unique guid or else things break. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 profile->SetRawMultiInfo(EMAIL_ADDRESS, emails); | 112 profile->SetRawMultiInfo(EMAIL_ADDRESS, emails); |
113 } | 113 } |
114 | 114 |
115 void AuxiliaryProfilesAndroid::LoadPhoneNumbers(AutofillProfile* profile) { | 115 void AuxiliaryProfilesAndroid::LoadPhoneNumbers(AutofillProfile* profile) { |
116 std::vector<base::string16> phone_numbers; | 116 std::vector<base::string16> phone_numbers; |
117 profile_loader_.GetPhoneNumbers(&phone_numbers); | 117 profile_loader_.GetPhoneNumbers(&phone_numbers); |
118 profile->SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, phone_numbers); | 118 profile->SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, phone_numbers); |
119 } | 119 } |
120 | 120 |
121 } // namespace autofill | 121 } // namespace autofill |
OLD | NEW |