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

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

Issue 23623019: Support datalist for date/time input types on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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/DateTimeChooserAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
index a45bc5734a2f250701c77f854f17ca96c6b35019..8cc41ff964eb6bec3e311e615f5a040b0c2a5d19 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
@@ -38,8 +38,9 @@ class DateTimeChooserAndroid {
}
private void showDialog(int dialogType, double dialogValue,
- double min, double max, double step) {
- mInputDialogContainer.showDialog(dialogType, dialogValue, min, max, step);
+ double min, double max, double step,
+ DateTimeSuggestion[] suggestions) {
+ mInputDialogContainer.showDialog(dialogType, dialogValue, min, max, step, suggestions);
}
@CalledByNative
@@ -47,21 +48,41 @@ class DateTimeChooserAndroid {
ContentViewCore contentViewCore,
long nativeDateTimeChooserAndroid,
int dialogType, double dialogValue,
- double min, double max, double step) {
+ double min, double max, double step,
+ DateTimeSuggestion[] suggestions) {
DateTimeChooserAndroid chooser =
new DateTimeChooserAndroid(
contentViewCore.getContext(),
nativeDateTimeChooserAndroid);
- chooser.showDialog(dialogType, dialogValue, min, max, step);
+ chooser.showDialog(dialogType, dialogValue, min, max, step, suggestions);
return chooser;
}
@CalledByNative
+ private static DateTimeSuggestion[] createSuggestionsArray(int size) {
+ return new DateTimeSuggestion[size];
+ }
+
+ /**
+ * @param array DateTimeSuggestion array that should get a new suggestion set.
+ * @param index Index in the array where to place a new suggestion.
+ * @param value Value of the suggestion.
+ * @param localizedValue Localized value of the suggestion.
+ * @param label Label of the suggestion.
+ */
+ @CalledByNative
+ private static void setDateTimeSuggestionAt(DateTimeSuggestion[] array, int index,
+ double value, String localizedValue, String label) {
+ array[index] = new DateTimeSuggestion(value, localizedValue, label);
+ }
+
+ @CalledByNative
private static void initializeDateInputTypes(
int textInputTypeDate, int textInputTypeDateTime,
int textInputTypeDateTimeLocal, int textInputTypeMonth,
int textInputTypeTime, int textInputTypeWeek) {
- InputDialogContainer.initializeInputTypes(textInputTypeDate,
+ InputDialogContainer.initializeInputTypes(
+ textInputTypeDate,
textInputTypeDateTime, textInputTypeDateTimeLocal,
textInputTypeMonth, textInputTypeTime, textInputTypeWeek);
}

Powered by Google App Engine
This is Rietveld 408576698