OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.ui.autofill; | 5 package org.chromium.ui.autofill; |
6 | 6 |
7 import org.chromium.ui.DropdownItem; | 7 import org.chromium.ui.DropdownItem; |
8 | 8 |
9 /** | 9 /** |
10 * Autofill suggestion container used to store information needed for each Autof
ill popup entry. | 10 * Autofill suggestion container used to store information needed for each Autof
ill popup entry. |
11 */ | 11 */ |
12 public class AutofillSuggestion implements DropdownItem { | 12 public class AutofillSuggestion implements DropdownItem { |
13 private final String mLabel; | 13 private final String mLabel; |
14 private final String mSublabel; | 14 private final String mSublabel; |
15 private final int mUniqueId; | 15 private final int mSuggestionId; |
16 | 16 |
17 /** | 17 /** |
18 * Constructs a Autofill suggestion container. | 18 * Constructs a Autofill suggestion container. |
19 * @param name The name of the Autofill suggestion. | 19 * @param name The name of the Autofill suggestion. |
20 * @param label The describing label 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. | 21 * @param suggestionId The type of suggestion. |
22 */ | 22 */ |
23 public AutofillSuggestion(String name, String label, int uniqueId) { | 23 public AutofillSuggestion(String name, String label, int suggestionId) { |
24 mLabel = name; | 24 mLabel = name; |
25 mSublabel = label; | 25 mSublabel = label; |
26 mUniqueId = uniqueId; | 26 mSuggestionId = suggestionId; |
27 } | 27 } |
28 | 28 |
29 @Override | 29 @Override |
30 public String getLabel() { | 30 public String getLabel() { |
31 return mLabel; | 31 return mLabel; |
32 } | 32 } |
33 | 33 |
34 @Override | 34 @Override |
35 public String getSublabel() { | 35 public String getSublabel() { |
36 return mSublabel; | 36 return mSublabel; |
37 } | 37 } |
38 | 38 |
39 @Override | 39 @Override |
40 public boolean isEnabled() { | 40 public boolean isEnabled() { |
41 return true; | 41 return true; |
42 } | 42 } |
43 | 43 |
44 @Override | 44 @Override |
45 public boolean isGroupHeader() { | 45 public boolean isGroupHeader() { |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 public int getUniqueId() { | 49 public int getSuggestionId() { |
50 return mUniqueId; | 50 return mSuggestionId; |
51 } | 51 } |
52 } | 52 } |
OLD | NEW |