| 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_array.h" | 7 #include "base/android/jni_array.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return GetPrefs()->GetBoolean(autofill::prefs::kAutofillWalletImportEnabled); | 329 return GetPrefs()->GetBoolean(autofill::prefs::kAutofillWalletImportEnabled); |
| 330 } | 330 } |
| 331 | 331 |
| 332 // Enables or disables the Wallet import feature. | 332 // Enables or disables the Wallet import feature. |
| 333 static void SetWalletImportEnabled(JNIEnv* env, jclass clazz, jboolean enable) { | 333 static void SetWalletImportEnabled(JNIEnv* env, jclass clazz, jboolean enable) { |
| 334 GetPrefs()->SetBoolean(autofill::prefs::kAutofillWalletImportEnabled, enable); | 334 GetPrefs()->SetBoolean(autofill::prefs::kAutofillWalletImportEnabled, enable); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using | 337 // Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using |
| 338 // the application locale, or an empty string. | 338 // the application locale, or an empty string. |
| 339 static ScopedJavaLocalRef<jstring> ToCountryCode(JNIEnv* env, | 339 static jstring ToCountryCode(JNIEnv* env, jclass clazz, jstring jcountry_name) { |
| 340 jclass clazz, | |
| 341 jstring jcountry_name) { | |
| 342 return ConvertUTF8ToJavaString( | 340 return ConvertUTF8ToJavaString( |
| 343 env, AutofillCountry::GetCountryCode( | 341 env, |
| 344 base::android::ConvertJavaStringToUTF16(env, jcountry_name), | 342 AutofillCountry::GetCountryCode( |
| 345 g_browser_process->GetApplicationLocale())); | 343 base::android::ConvertJavaStringToUTF16(env, jcountry_name), |
| 344 g_browser_process->GetApplicationLocale())).Release(); |
| 346 } | 345 } |
| 347 | 346 |
| 348 static jlong Init(JNIEnv* env, jobject obj) { | 347 static jlong Init(JNIEnv* env, jobject obj) { |
| 349 PersonalDataManagerAndroid* personal_data_manager_android = | 348 PersonalDataManagerAndroid* personal_data_manager_android = |
| 350 new PersonalDataManagerAndroid(env, obj); | 349 new PersonalDataManagerAndroid(env, obj); |
| 351 return reinterpret_cast<intptr_t>(personal_data_manager_android); | 350 return reinterpret_cast<intptr_t>(personal_data_manager_android); |
| 352 } | 351 } |
| 353 | 352 |
| 354 } // namespace autofill | 353 } // namespace autofill |
| OLD | NEW |