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

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: Used double to transfer value Created 7 years, 2 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/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 9ca9f955e9b97ebe43b430ab6cdc947a4102e705..442d94eeada8f583dd99a005bd9e13e6d3c05e72 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
@@ -26,13 +26,8 @@ class DateTimeChooserAndroid {
new InputDialogContainer.InputActionDelegate() {
@Override
- public void replaceDateTime(
- int dialogType,
- int year, int month, int day, int hour, int minute,
- int second, int milli, int week) {
- nativeReplaceDateTime(mNativeDateTimeChooserAndroid,
- dialogType,
- year, month, day, hour, minute, second, milli, week);
+ public void replaceDateTime(double value) {
+ nativeReplaceDateTime(mNativeDateTimeChooserAndroid, value);
}
@Override
@@ -42,45 +37,52 @@ class DateTimeChooserAndroid {
});
}
- private void showDialog(int dialogType, int year, int month, int monthDay,
- int hour, int minute, int second, int milli,
- int week, double min, double max, double step) {
+ private void showDialog(int dialogType, double value,
+ double min, double max, double step,
+ DateTimeSuggestion[] suggestions) {
mInputDialogContainer.showDialog(
- dialogType, year, month, monthDay,
- hour, minute, second, milli, week, min, max, step);
+ dialogType, value, min, max, step, suggestions);
}
@CalledByNative
private static DateTimeChooserAndroid createDateTimeChooser(
ContentViewCore contentViewCore,
- int nativeDateTimeChooserAndroid, int dialogType,
- int year, int month, int day,
- int hour, int minute, int second, int milli, int week,
- double min, double max, double step) {
+ int nativeDateTimeChooserAndroid,
+ int dialogType, double value,
+ double min, double max, double step,
+ DateTimeSuggestion[] suggestions) {
DateTimeChooserAndroid chooser =
new DateTimeChooserAndroid(
contentViewCore.getContext(),
nativeDateTimeChooserAndroid);
- chooser.showDialog(
- dialogType, year, month, day, hour, minute, second, milli,
- week, min, max, step);
+ chooser.showDialog(dialogType, value, min, max, step, suggestions);
return chooser;
}
+ /**
+ * @param value Value of the suggestion.
+ * @param localizedValue Localized value of the suggestion.
+ * @param label Label of the suggestion.
+ */
+ @CalledByNative
+ private static DateTimeSuggestion createDateTimeSuggestion(
+ double value, String localizedValue, String label) {
+ return 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);
}
private native void nativeReplaceDateTime(
- int nativeDateTimeChooserAndroid, int dialogType,
- int year, int month, int day, int hour, int minute,
- int second, int milli, int week);
+ int nativeDateTimeChooserAndroid, double value);
private native void nativeCancelDialog(int nativeDateTimeChooserAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698