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

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

Issue 11783088: Split Date/Time picker values from IME processing since date/time related form values have been com… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 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/DateTimeChooserAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/DateTimeChooserAndroid.java b/content/public/android/java/src/org/chromium/content/browser/DateTimeChooserAndroid.java
new file mode 100644
index 0000000000000000000000000000000000000000..8d6296cb53613bbf735a3225130c000c32daa8b2
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/DateTimeChooserAndroid.java
@@ -0,0 +1,60 @@
+package org.chromium.content.browser;
bulach 2013/01/10 15:58:35 nit: missing Copyright header
Miguel Garcia 2013/01/11 14:59:37 Done.
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+import android.content.Context;
+
+/**
+ * Plumbing for the different date/time dialog adapters.
+ */
+@JNINamespace("content")
+public class DateTimeChooserAndroid {
bulach 2013/01/10 15:58:35 nit: make the class and its ctor package-protected
Miguel Garcia 2013/01/11 14:59:37 Correct. Done On 2013/01/10 15:58:35, bulach wrot
+
+ private final int mNativeDateTimeChooserAndroid;
+ private final InputDialogContainer mInputDialogContainer;
+
+ public DateTimeChooserAndroid(Context context,
+ int nativeDateTimeChooserAndroid) {
+ mNativeDateTimeChooserAndroid = nativeDateTimeChooserAndroid;
+ mInputDialogContainer = new InputDialogContainer(context,
+ new InputDialogContainer.InputActionDelegate() {
+
+ @Override
+ public void replaceDateTime(String text) {
+ nativeReplaceDateTime(mNativeDateTimeChooserAndroid, text);
+ }
+
+ @Override
+ public void cancelDateTimeDialog() {
+ nativeCancelDialog(mNativeDateTimeChooserAndroid);
+ }
+ });
+ }
+
+ private void showDialog(int dialogType, String text) {
+ mInputDialogContainer.showDialog(text, dialogType);
+ }
+
+ @CalledByNative
+ static DateTimeChooserAndroid createDateTimeChooser(
+ ContentViewCore contentViewCore,
+ int nativeDateTimeChooserAndroid, String text, int dialogType) {
+ DateTimeChooserAndroid chooser =
+ new DateTimeChooserAndroid(
+ contentViewCore.getContext(), nativeDateTimeChooserAndroid);
+ chooser.showDialog(dialogType, text);
+ return chooser;
+ }
+
+ @CalledByNative
+ static void initializeDateInputTypes(int textInputTypeDate, int textInputTypeDateTime,
+ int textInputTypeDateTimeLocal, int textInputTypeMonth,
+ int textInputTypeTime) {
+ InputDialogContainer.initializeInputTypes(textInputTypeDate, textInputTypeDateTime,
+ textInputTypeDateTimeLocal, textInputTypeMonth, textInputTypeTime);
+ }
+
+ private native void nativeReplaceDateTime(int nativeDateTimeChooserAndroid, String text);
+ private native void nativeCancelDialog(int nativeDateTimeChooserAndroid);
+}

Powered by Google App Engine
This is Rietveld 408576698