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

Unified Diff: components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java

Issue 2839023003: WebView autofill implementation (Closed)
Patch Set: Refactoring AutofillManager Created 3 years, 7 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: components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java b/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java
new file mode 100644
index 0000000000000000000000000000000000000000..f484efc10a37c4bc26d422c3482a6257825b7b4e
--- /dev/null
+++ b/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java
@@ -0,0 +1,54 @@
+// Copyright 2017 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.components.autofill;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+
+/**
+ * The wrap class of native autofill::FormFieldData.
Mathieu 2017/05/24 18:02:02 FormFieldDataAndroid?
michaelbai 2017/05/26 23:12:08 Done.
+ */
+@JNINamespace("autofill")
+public class FormFieldData {
+ public final String mLabel;
+ public final String mName;
+ public final String mAutocompleteAttr;
+ public final boolean mShouldAutocomplete;
+ public final String mPlaceholder;
+ public final String mType;
+ public final String mId;
+
+ private String mValue;
+
+ private FormFieldData(String name, String label, String value, String autocompleteAttr,
+ boolean shouldAutocomplete, String placeholder, String type, String id) {
+ mName = name;
+ mLabel = label;
+ mValue = value;
+ mAutocompleteAttr = autocompleteAttr;
+ mShouldAutocomplete = shouldAutocomplete;
+ mPlaceholder = placeholder;
+ mType = type;
+ mId = id;
+ }
+
+ @CalledByNative
+ public String getValue() {
Mathieu 2017/05/24 18:02:02 public methods should have javadoc
michaelbai 2017/05/26 23:12:08 Done.
+ return mValue;
+ }
+
+ @CalledByNative
+ public void updateValue(String value) {
+ mValue = value;
+ }
+
+ @CalledByNative
+ private static FormFieldData createFormFieldData(String name, String label, String value,
+ String autocompleteAttr, boolean shouldAutocomplete, String placeholder, String type,
+ String id) {
+ return new FormFieldData(
+ name, label, value, autocompleteAttr, shouldAutocomplete, placeholder, type, id);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698