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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 | 346 |
347 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using | 347 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using |
348 // the application locale, or an empty string. | 348 // the application locale, or an empty string. |
349 static ScopedJavaLocalRef<jstring> ToCountryCode( | 349 static ScopedJavaLocalRef<jstring> ToCountryCode( |
350 JNIEnv* env, | 350 JNIEnv* env, |
351 const JavaParamRef<jclass>& clazz, | 351 const JavaParamRef<jclass>& clazz, |
352 const JavaParamRef<jstring>& jcountry_name) { | 352 const JavaParamRef<jstring>& jcountry_name) { |
353 return ConvertUTF8ToJavaString( | 353 return ConvertUTF8ToJavaString( |
354 env, CountryNames::GetInstance()->GetCountryCode( | 354 env, CountryNames::GetInstance()->GetCountryCode( |
355 base::android::ConvertJavaStringToUTF16(env, jcountry_name), | 355 base::android::ConvertJavaStringToUTF16(env, jcountry_name))); |
356 g_browser_process->GetApplicationLocale())); | |
357 } | 356 } |
358 | 357 |
359 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 358 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
360 PersonalDataManagerAndroid* personal_data_manager_android = | 359 PersonalDataManagerAndroid* personal_data_manager_android = |
361 new PersonalDataManagerAndroid(env, obj); | 360 new PersonalDataManagerAndroid(env, obj); |
362 return reinterpret_cast<intptr_t>(personal_data_manager_android); | 361 return reinterpret_cast<intptr_t>(personal_data_manager_android); |
363 } | 362 } |
364 | 363 |
365 } // namespace autofill | 364 } // namespace autofill |
OLD | NEW |