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 #include "chrome/browser/autofill/android/personal_data_manager_android.h" | 5 #include "chrome/browser/autofill/android/personal_data_manager_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 env, | 44 env, |
45 profile.GetRawInfo(ADDRESS_HOME_CITY)).obj(), | 45 profile.GetRawInfo(ADDRESS_HOME_CITY)).obj(), |
46 ConvertUTF16ToJavaString( | 46 ConvertUTF16ToJavaString( |
47 env, | 47 env, |
48 profile.GetRawInfo(ADDRESS_HOME_STATE)).obj(), | 48 profile.GetRawInfo(ADDRESS_HOME_STATE)).obj(), |
49 ConvertUTF16ToJavaString( | 49 ConvertUTF16ToJavaString( |
50 env, | 50 env, |
51 profile.GetRawInfo(ADDRESS_HOME_ZIP)).obj(), | 51 profile.GetRawInfo(ADDRESS_HOME_ZIP)).obj(), |
52 ConvertUTF16ToJavaString( | 52 ConvertUTF16ToJavaString( |
53 env, | 53 env, |
54 profile.GetRawInfo(ADDRESS_HOME_COUNTRY)).obj(), | 54 profile.GetInfo(ADDRESS_HOME_COUNTRY, |
| 55 g_browser_process->GetApplicationLocale())).obj(), |
55 ConvertUTF16ToJavaString( | 56 ConvertUTF16ToJavaString( |
56 env, | 57 env, |
57 profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)).obj(), | 58 profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)).obj(), |
58 ConvertUTF16ToJavaString(env, profile.GetRawInfo(EMAIL_ADDRESS)).obj()); | 59 ConvertUTF16ToJavaString(env, profile.GetRawInfo(EMAIL_ADDRESS)).obj()); |
59 } | 60 } |
60 | 61 |
61 void PopulateNativeProfileFromJava( | 62 void PopulateNativeProfileFromJava( |
62 const jobject& jprofile, | 63 const jobject& jprofile, |
63 JNIEnv* env, | 64 JNIEnv* env, |
64 AutofillProfile* profile) { | 65 AutofillProfile* profile) { |
(...skipping 18 matching lines...) Expand all Loading... |
83 ConvertJavaStringToUTF16( | 84 ConvertJavaStringToUTF16( |
84 Java_AutofillProfile_getCity(env, jprofile))); | 85 Java_AutofillProfile_getCity(env, jprofile))); |
85 profile->SetRawInfo( | 86 profile->SetRawInfo( |
86 ADDRESS_HOME_STATE, | 87 ADDRESS_HOME_STATE, |
87 ConvertJavaStringToUTF16( | 88 ConvertJavaStringToUTF16( |
88 Java_AutofillProfile_getState(env, jprofile))); | 89 Java_AutofillProfile_getState(env, jprofile))); |
89 profile->SetRawInfo( | 90 profile->SetRawInfo( |
90 ADDRESS_HOME_ZIP, | 91 ADDRESS_HOME_ZIP, |
91 ConvertJavaStringToUTF16( | 92 ConvertJavaStringToUTF16( |
92 Java_AutofillProfile_getZip(env, jprofile))); | 93 Java_AutofillProfile_getZip(env, jprofile))); |
93 profile->SetRawInfo( | 94 profile->SetInfo( |
94 ADDRESS_HOME_COUNTRY, | 95 ADDRESS_HOME_COUNTRY, |
95 ConvertJavaStringToUTF16( | 96 ConvertJavaStringToUTF16( |
96 Java_AutofillProfile_getCountry(env, jprofile))); | 97 Java_AutofillProfile_getCountry(env, jprofile)), |
| 98 g_browser_process->GetApplicationLocale()); |
97 profile->SetRawInfo( | 99 profile->SetRawInfo( |
98 PHONE_HOME_WHOLE_NUMBER, | 100 PHONE_HOME_WHOLE_NUMBER, |
99 ConvertJavaStringToUTF16( | 101 ConvertJavaStringToUTF16( |
100 Java_AutofillProfile_getPhoneNumber(env, jprofile))); | 102 Java_AutofillProfile_getPhoneNumber(env, jprofile))); |
101 profile->SetRawInfo( | 103 profile->SetRawInfo( |
102 EMAIL_ADDRESS, | 104 EMAIL_ADDRESS, |
103 ConvertJavaStringToUTF16( | 105 ConvertJavaStringToUTF16( |
104 Java_AutofillProfile_getEmailAddress(env, jprofile))); | 106 Java_AutofillProfile_getEmailAddress(env, jprofile))); |
105 } | 107 } |
106 | 108 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // static | 272 // static |
271 bool PersonalDataManagerAndroid::Register(JNIEnv* env) { | 273 bool PersonalDataManagerAndroid::Register(JNIEnv* env) { |
272 return RegisterNativesImpl(env); | 274 return RegisterNativesImpl(env); |
273 } | 275 } |
274 | 276 |
275 static jint Init(JNIEnv* env, jobject obj) { | 277 static jint Init(JNIEnv* env, jobject obj) { |
276 PersonalDataManagerAndroid* personal_data_manager_android = | 278 PersonalDataManagerAndroid* personal_data_manager_android = |
277 new PersonalDataManagerAndroid(env, obj); | 279 new PersonalDataManagerAndroid(env, obj); |
278 return reinterpret_cast<jint>(personal_data_manager_android); | 280 return reinterpret_cast<jint>(personal_data_manager_android); |
279 } | 281 } |
OLD | NEW |