| Index: content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java b/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java
|
| index d32266b0f442f74552f81f4e95586c34a1867b18..4db838ec968d7ccd49599cfbaed863493e6c0467 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java
|
| @@ -8,6 +8,7 @@ import org.chromium.content.browser.ContentViewCore;
|
|
|
| import android.app.AlertDialog;
|
| import android.content.DialogInterface;
|
| +import android.content.res.TypedArray;
|
| import android.util.SparseBooleanArray;
|
| import android.view.View;
|
| import android.view.ViewGroup;
|
| @@ -17,6 +18,8 @@ import android.widget.ArrayAdapter;
|
| import android.widget.CheckedTextView;
|
| import android.widget.ListView;
|
|
|
| +import org.chromium.content.R;
|
| +
|
| /**
|
| * Handles the popup dialog for the <select> HTML tag support.
|
| */
|
| @@ -24,6 +27,11 @@ public class SelectPopupDialog {
|
| // The currently showing popup dialog, null if none is showing.
|
| private static SelectPopupDialog sShownDialog;
|
|
|
| + private static final int[] SELECT_DIALOG_ATTRS = {
|
| + R.attr.select_dialog_multichoice,
|
| + R.attr.select_dialog_singlechoice
|
| + };
|
| +
|
| // The dialog hosting the popup list view.
|
| private AlertDialog mListBoxPopup = null;
|
|
|
| @@ -48,9 +56,7 @@ public class SelectPopupDialog {
|
| private boolean mAreAllItemsEnabled;
|
|
|
| public SelectPopupArrayAdapter(String[] labels, int[] enabled, boolean multiple) {
|
| - super(mContentViewCore.getContext(), multiple ?
|
| - android.R.layout.select_dialog_multichoice :
|
| - android.R.layout.select_dialog_singlechoice, labels);
|
| + super(mContentViewCore.getContext(), getSelectDialogLayout(multiple), labels);
|
| mItemEnabled = enabled;
|
| mAreAllItemsEnabled = true;
|
| for (int item : mItemEnabled) {
|
| @@ -99,6 +105,15 @@ public class SelectPopupDialog {
|
| }
|
| }
|
|
|
| + private int getSelectDialogLayout(boolean isMultiChoice) {
|
| + int resource_id;
|
| + TypedArray styledAttributes = mContentViewCore.getContext().obtainStyledAttributes(
|
| + R.style.SelectPopupDialog, SELECT_DIALOG_ATTRS);
|
| + resource_id = styledAttributes.getResourceId(isMultiChoice ? 0 : 1, 0);
|
| + styledAttributes.recycle();
|
| + return resource_id;
|
| + }
|
| +
|
| private SelectPopupDialog(ContentViewCore contentViewCore, String[] labels, int[] enabled,
|
| boolean multiple, int[] selected) {
|
| mContentViewCore = contentViewCore;
|
|
|