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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 351 } |
352 | 352 |
353 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using | 353 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using |
354 // the application locale, or an empty string. | 354 // the application locale, or an empty string. |
355 static ScopedJavaLocalRef<jstring> ToCountryCode( | 355 static ScopedJavaLocalRef<jstring> ToCountryCode( |
356 JNIEnv* env, | 356 JNIEnv* env, |
357 const JavaParamRef<jclass>& clazz, | 357 const JavaParamRef<jclass>& clazz, |
358 const JavaParamRef<jstring>& jcountry_name) { | 358 const JavaParamRef<jstring>& jcountry_name) { |
359 return ConvertUTF8ToJavaString( | 359 return ConvertUTF8ToJavaString( |
360 env, CountryNames::GetInstance()->GetCountryCode( | 360 env, CountryNames::GetInstance()->GetCountryCode( |
361 base::android::ConvertJavaStringToUTF16(env, jcountry_name), | 361 base::android::ConvertJavaStringToUTF16(env, jcountry_name))); |
362 g_browser_process->GetApplicationLocale())); | |
363 } | 362 } |
364 | 363 |
365 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 364 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
366 PersonalDataManagerAndroid* personal_data_manager_android = | 365 PersonalDataManagerAndroid* personal_data_manager_android = |
367 new PersonalDataManagerAndroid(env, obj); | 366 new PersonalDataManagerAndroid(env, obj); |
368 return reinterpret_cast<intptr_t>(personal_data_manager_android); | 367 return reinterpret_cast<intptr_t>(personal_data_manager_android); |
369 } | 368 } |
370 | 369 |
371 } // namespace autofill | 370 } // namespace autofill |
OLD | NEW |