Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java

Issue 872023002: Use floating labels for preference forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome/browser/BUILD.gn Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java
new file mode 100644
index 0000000000000000000000000000000000000000..0e590f25bf35b10663ec3d58d0216bbef7140b6c
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.preferences.autofill;
+
+import android.util.Pair;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Static methods to fetch information needed to create the address fields for the autofill profile
+ * form.
+ */
+@JNINamespace("autofill::android")
+public class AutofillProfileBridge {
+ public static List<String> getAvailableCountries() {
+ List<String> countries = new ArrayList<String>();
+ nativeGetAvailableCountries(countries);
+ return countries;
+ }
+
+ public static List<Pair<String, String>> getAddressUiComponents(String countryCode,
+ String uiLanguageTag) {
+ List<String> componentIds = new ArrayList<String>();
+ List<String> componentNames = new ArrayList<String>();
+ List<Pair<String, String>> uiComponents = new ArrayList<Pair<String, String>>();
+ nativeGetAddressUiComponents(countryCode, uiLanguageTag, componentIds, componentNames);
+ for (int i = 0; i < componentIds.size(); i++) {
+ uiComponents.add(new Pair<String, String>(componentIds.get(i), componentNames.get(i)));
+ }
+ return uiComponents;
+ }
+
+ @CalledByNative
+ private static void stringArrayToList(String[] array, List<String> list) {
+ for (String s : array) {
+ list.add(s);
+ }
+ }
+
+ private static native void nativeGetAvailableCountries(List<String> countries);
+ private static native void nativeGetAddressUiComponents(String countryCode,
+ String uiLanguageTag, List<String> componentIds, List<String> componentNames);
+}

Powered by Google App Engine
This is Rietveld 408576698