1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_
8 #include "base/android/jni_weak_ref.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "chrome/browser/ui/autofill/country_combobox_model.h"
14 // A bridge class for showing a list of countries in the Android settings UI.
15 class CountryAdapterAndroid {
17 CountryAdapterAndroid(JNIEnv* env, jobject obj);
19 // Gets all the country codes and names. Every even index is a country name,
20 // and the following odd index is the associated country code.
21 base::android::ScopedJavaLocalRef<jobjectArray>
22 GetItems(JNIEnv* env, jobject unused_obj);
24 // Registers the JNI bindings for this class.
25 static bool Register(JNIEnv* env);
28 ~CountryAdapterAndroid();
30 // Pointer to the java counterpart.
31 JavaObjectWeakGlobalRef weak_java_obj_;
33 CountryComboboxModel country_combobox_model_;
36 } // namespace autofill
38 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_