AutofillSuggestion.java revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
1// Copyright 2013 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 5package org.chromium.ui.autofill; 6 7import org.chromium.ui.DropdownItem; 8 9/** 10 * Autofill suggestion container used to store information needed for each Autofill popup entry. 11 */ 12public class AutofillSuggestion implements DropdownItem { 13 private final String mLabel; 14 private final String mSublabel; 15 private final int mUniqueId; 16 17 /** 18 * Constructs a Autofill suggestion container. 19 * @param name The name of the Autofill suggestion. 20 * @param label The describing label of the Autofill suggestion. 21 * @param uniqueId The unique id used to identify the Autofill suggestion. 22 */ 23 public AutofillSuggestion(String name, String label, int uniqueId) { 24 mLabel = name; 25 mSublabel = label; 26 mUniqueId = uniqueId; 27 } 28 29 @Override 30 public String getLabel() { 31 return mLabel; 32 } 33 34 @Override 35 public String getSublabel() { 36 return mSublabel; 37 } 38 39 @Override 40 public boolean isEnabled() { 41 return true; 42 } 43 44 @Override 45 public boolean isGroupHeader() { 46 return false; 47 } 48 49 public int getUniqueId() { 50 return mUniqueId; 51 } 52} 53