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

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..385b2fbacff8f1ca0b405ae1fa7c5388c8aad18d
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/DateTimeChooserAndroid.java
@@ -0,0 +1,64 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+import android.content.Context;
+
+/**
+ * Plumbing for the different date/time dialog adapters.
+ */
+@JNINamespace("content")
+class DateTimeChooserAndroid {
+
+ private final int mNativeDateTimeChooserAndroid;
+ private final InputDialogContainer mInputDialogContainer;
+
+ private 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
+ private 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
+ private 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);
+}
« no previous file with comments | « content/content_jni.gypi ('k') | content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698