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..4436b2410067e69ee0a78370d3af32ed3219cb31 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 |
@@ -39,15 +39,21 @@ class DateTimeChooserAndroid { |
public void cancelDateTimeDialog() { |
nativeCancelDialog(mNativeDateTimeChooserAndroid); |
} |
+ |
+ @Override |
+ public void acceptDataListSuggestion(String value) { |
+ nativeAcceptDataListSuggestion(mNativeDateTimeChooserAndroid, value); |
+ } |
}); |
} |
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) { |
+ int week, double min, double max, double step, |
+ DateTimeSuggestion[] suggestions) { |
mInputDialogContainer.showDialog( |
dialogType, year, month, monthDay, |
- hour, minute, second, milli, week, min, max, step); |
+ hour, minute, second, milli, week, min, max, step, suggestions); |
} |
@CalledByNative |
@@ -56,18 +62,37 @@ class DateTimeChooserAndroid { |
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) { |
+ 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); |
+ week, min, max, step, suggestions); |
return chooser; |
} |
@CalledByNative |
+ private static DateTimeSuggestion[] createDateTimeSuggestionArray(int size) { |
Miguel Garcia
2013/10/08 17:44:40
why do you need to preallocate the array in java?
keishi
2013/10/21 17:00:58
Done.
|
+ return new DateTimeSuggestion[size]; |
+ } |
+ |
+ /** |
+ * @param array ColorSuggestion array that should get a new suggestion added. |
Miguel Garcia
2013/10/08 17:44:40
color suggestion? :)
No need to add suggestions o
keishi
2013/10/21 17:00:58
Done.
|
+ * @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 addToDateTimeSuggestionArray(DateTimeSuggestion[] array, int index, |
+ String 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, |
@@ -83,4 +108,7 @@ class DateTimeChooserAndroid { |
int second, int milli, int week); |
private native void nativeCancelDialog(int nativeDateTimeChooserAndroid); |
+ |
+ private native void nativeAcceptDataListSuggestion( |
Miguel Garcia
2013/10/08 17:44:40
don't add an extra JNI method, I think you can jus
keishi
2013/10/21 17:00:58
Done.
|
+ int nativeDateTimeChooserAndroid, String value); |
} |