OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 package org.chromium.components.autofill; |
| 6 |
| 7 import org.chromium.base.annotations.CalledByNative; |
| 8 import org.chromium.base.annotations.JNINamespace; |
| 9 |
| 10 /** |
| 11 * The wrap class of native autofill::FormFieldDataAndroid. |
| 12 */ |
| 13 @JNINamespace("autofill") |
| 14 public class FormFieldData { |
| 15 public final String mLabel; |
| 16 public final String mName; |
| 17 public final String mAutocompleteAttr; |
| 18 public final boolean mShouldAutocomplete; |
| 19 public final String mPlaceholder; |
| 20 public final String mType; |
| 21 public final String mId; |
| 22 |
| 23 private String mValue; |
| 24 |
| 25 private FormFieldData(String name, String label, String value, String autoco
mpleteAttr, |
| 26 boolean shouldAutocomplete, String placeholder, String type, String
id) { |
| 27 mName = name; |
| 28 mLabel = label; |
| 29 mValue = value; |
| 30 mAutocompleteAttr = autocompleteAttr; |
| 31 mShouldAutocomplete = shouldAutocomplete; |
| 32 mPlaceholder = placeholder; |
| 33 mType = type; |
| 34 mId = id; |
| 35 } |
| 36 |
| 37 /** |
| 38 * @return value of field. |
| 39 */ |
| 40 @CalledByNative |
| 41 public String getValue() { |
| 42 return mValue; |
| 43 } |
| 44 |
| 45 @CalledByNative |
| 46 public void updateValue(String value) { |
| 47 mValue = value; |
| 48 } |
| 49 |
| 50 @CalledByNative |
| 51 private static FormFieldData createFormFieldData(String name, String label,
String value, |
| 52 String autocompleteAttr, boolean shouldAutocomplete, String placehol
der, String type, |
| 53 String id) { |
| 54 return new FormFieldData( |
| 55 name, label, value, autocompleteAttr, shouldAutocomplete, placeh
older, type, id); |
| 56 } |
| 57 } |
OLD | NEW |