Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDialog.java

Issue 231953003: Show Ash like <select> popup on Android tablets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newpopupx
Patch Set: Rebased Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3313d8836f52aeab377845cde168aa4d226c6fa7..1ebbbf7da49296b4e30f66d4dc529bf798248236 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
@@ -22,7 +22,7 @@ import java.util.List;
/**
* Handles the popup dialog for the <select> HTML tag support.
*/
-public class SelectPopupDialog {
+public class SelectPopupDialog implements SelectPopup {
private static final int[] SELECT_DIALOG_ATTRS = {
R.attr.select_dialog_multichoice,
R.attr.select_dialog_singlechoice
@@ -34,7 +34,7 @@ public class SelectPopupDialog {
private final ContentViewCore mContentViewCore;
private final Context mContext;
- private SelectPopupDialog(ContentViewCore contentViewCore, List<SelectPopupItem> items,
+ public SelectPopupDialog(ContentViewCore contentViewCore, List<SelectPopupItem> items,
boolean multiple, int[] selected) {
mContentViewCore = contentViewCore;
mContext = mContentViewCore.getContext();
@@ -121,27 +121,13 @@ public class SelectPopupDialog {
return indices;
}
- /**
- * Hides the select dialog.
- */
- public void hide() {
- mListBoxPopup.cancel();
+ @Override
+ public void show() {
+ mListBoxPopup.show();
}
- /**
- * Shows the popup menu triggered by the passed ContentView.
- * Hides any currently shown popup.
- * @param items Items to show.
- * @param multiple Whether the popup menu should support multi-select.
- * @param selectedIndices Indices of selected items.
- * @return The select dialog created.
- */
- public static SelectPopupDialog show(
- ContentViewCore contentViewCore, List<SelectPopupItem> items,
- boolean multiple, int[] selectedIndices) {
- SelectPopupDialog dialog = new SelectPopupDialog(
- contentViewCore, items, multiple, selectedIndices);
- dialog.mListBoxPopup.show();
- return dialog;
+ @Override
+ public void hide() {
+ mListBoxPopup.cancel();
}
}

Powered by Google App Engine
This is Rietveld 408576698