OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_ | |
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_ | |
7 | |
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" | |
11 | |
12 namespace autofill { | |
13 | |
14 // A bridge class for showing a list of countries in the Android settings UI. | |
15 class CountryAdapterAndroid { | |
16 public: | |
17 CountryAdapterAndroid(JNIEnv* env, jobject obj); | |
18 | |
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); | |
23 | |
24 // Registers the JNI bindings for this class. | |
25 static bool Register(JNIEnv* env); | |
26 | |
27 private: | |
28 ~CountryAdapterAndroid(); | |
29 | |
30 // Pointer to the java counterpart. | |
31 JavaObjectWeakGlobalRef weak_java_obj_; | |
32 | |
33 CountryComboboxModel country_combobox_model_; | |
34 }; | |
35 | |
36 } // namespace autofill | |
37 | |
38 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_COUNTRY_ADAPTER_ANDROID_H_ | |
OLD | NEW |