| 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 c5b42ac872cb6d864669c31df73b7ec4f5b4524b..a9008e875d578e2d375e1769aab2d8ea658683ac 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,58 @@ 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) {
|
| - mInputDialogContainer.showDialog(
|
| - dialogType, year, month, monthDay,
|
| - hour, minute, second, milli, week, min, max, step);
|
| + private void showDialog(int dialogType, double dialogValue,
|
| + double min, double max, double step,
|
| + DateTimeSuggestion[] suggestions) {
|
| + mInputDialogContainer.showDialog(dialogType, dialogValue, min, max, step, suggestions);
|
| }
|
|
|
| @CalledByNative
|
| private static DateTimeChooserAndroid createDateTimeChooser(
|
| ContentViewCore contentViewCore,
|
| - long 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) {
|
| + long nativeDateTimeChooserAndroid,
|
| + int dialogType, double dialogValue,
|
| + 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, dialogValue, min, max, step, suggestions);
|
| return chooser;
|
| }
|
|
|
| + @CalledByNative
|
| + private static DateTimeSuggestion[] createSuggestionsArray(int size) {
|
| + return new DateTimeSuggestion[size];
|
| + }
|
| +
|
| + /**
|
| + * @param array ColorSuggestion array that should get a new suggestion added.
|
| + * @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);
|
| }
|
|
|
| - private native void nativeReplaceDateTime(
|
| - long nativeDateTimeChooserAndroid, int dialogType,
|
| - int year, int month, int day, int hour, int minute,
|
| - int second, int milli, int week);
|
| + private native void nativeReplaceDateTime(long nativeDateTimeChooserAndroid,
|
| + double dialogValue);
|
|
|
| private native void nativeCancelDialog(long nativeDateTimeChooserAndroid);
|
| }
|
|
|