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 
5 package org.chromium.content.browser.input;
6 
7 import org.chromium.ui.DropdownItemBase;
8 
9 /**
10  * Select popup item containing the label, the type and the enabled state
11  * of an item belonging to a select popup dialog.
12  */
13 public class SelectPopupItem extends DropdownItemBase {
14     private final String mLabel;
15     private final int mType;
16 
SelectPopupItem(String label, int type)17     public SelectPopupItem(String label, int type) {
18         mLabel = label;
19         mType = type;
20     }
21 
22     @Override
getLabel()23     public String getLabel() {
24         return mLabel;
25     }
26 
27     @Override
isEnabled()28     public boolean isEnabled() {
29         return mType == PopupItemType.ENABLED || mType == PopupItemType.GROUP;
30     }
31 
32     @Override
isGroupHeader()33     public boolean isGroupHeader() {
34         return mType == PopupItemType.GROUP;
35     }
36 
getType()37     public int getType() {
38         return mType;
39     }
40 }
41