| 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 mIconId; |
| 15 private final int mSuggestionId; | 16 private final int mSuggestionId; |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * Constructs a Autofill suggestion container. | 19 * Constructs a Autofill suggestion container. |
| 19 * @param name The name of the Autofill suggestion. | 20 * @param name The name of the Autofill suggestion. |
| 20 * @param label The describing label of the Autofill suggestion. | 21 * @param label The describing label of the Autofill suggestion. |
| 21 * @param suggestionId The type of suggestion. | 22 * @param suggestionId The type of suggestion. |
| 22 */ | 23 */ |
| 23 public AutofillSuggestion(String name, String label, int suggestionId) { | 24 public AutofillSuggestion(String name, String label, int iconId, int suggest
ionId) { |
| 24 mLabel = name; | 25 mLabel = name; |
| 25 mSublabel = label; | 26 mSublabel = label; |
| 27 mIconId = iconId; |
| 26 mSuggestionId = suggestionId; | 28 mSuggestionId = suggestionId; |
| 27 } | 29 } |
| 28 | 30 |
| 29 @Override | 31 @Override |
| 30 public String getLabel() { | 32 public String getLabel() { |
| 31 return mLabel; | 33 return mLabel; |
| 32 } | 34 } |
| 33 | 35 |
| 34 @Override | 36 @Override |
| 35 public String getSublabel() { | 37 public String getSublabel() { |
| 36 return mSublabel; | 38 return mSublabel; |
| 37 } | 39 } |
| 38 | 40 |
| 39 @Override | 41 @Override |
| 42 public int getIconId() { |
| 43 return mIconId; |
| 44 } |
| 45 |
| 46 @Override |
| 40 public boolean isEnabled() { | 47 public boolean isEnabled() { |
| 41 return true; | 48 return true; |
| 42 } | 49 } |
| 43 | 50 |
| 44 @Override | 51 @Override |
| 45 public boolean isGroupHeader() { | 52 public boolean isGroupHeader() { |
| 46 return false; | 53 return false; |
| 47 } | 54 } |
| 48 | 55 |
| 49 public int getSuggestionId() { | 56 public int getSuggestionId() { |
| 50 return mSuggestionId; | 57 return mSuggestionId; |
| 51 } | 58 } |
| 52 } | 59 } |
| OLD | NEW |