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

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

Issue 11418295: Use WebCore:DateTimeChooser for date/time form types instead of considering them text fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years 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/InputDialogContainer.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/InputDialogContainer.java b/content/public/android/java/src/org/chromium/content/browser/InputDialogContainer.java
index 56fd85f3da834ec16c8fdf59ac10590afc346633..590e87dba2cd7e063743cea8ade060288cbde432 100644
--- a/content/public/android/java/src/org/chromium/content/browser/InputDialogContainer.java
+++ b/content/public/android/java/src/org/chromium/content/browser/InputDialogContainer.java
@@ -29,8 +29,8 @@ import java.util.Date;
class InputDialogContainer {
interface InputActionDelegate {
- void clearFocus();
- void replaceText(String text);
+ void cancelDateTimeDialog();
+ void replaceDateTime(String dateTime);
}
// Default values used in Time representations of selected date/time before formatting.
@@ -122,6 +122,7 @@ class InputDialogContainer {
@Override
public void onClick(DialogInterface dialog, int which) {
mDialogAlreadyDismissed = true;
+ mInputActionDelegate.cancelDateTimeDialog();
}
});
@@ -131,16 +132,10 @@ class InputDialogContainer {
@Override
public void onClick(DialogInterface dialog, int which) {
mDialogAlreadyDismissed = true;
- mInputActionDelegate.replaceText("");
+ mInputActionDelegate.replaceDateTime("");
}
});
- mDialog.setOnDismissListener(new OnDismissListener() {
- @Override
- public void onDismiss(DialogInterface dialog) {
- mInputActionDelegate.clearFocus();
- }
- });
mDialogAlreadyDismissed = false;
mDialog.show();
}
@@ -250,8 +245,8 @@ class InputDialogContainer {
private void setFieldDateTimeValue(int year, int month, int monthDay, int hourOfDay,
int minute, String dateFormat) {
- // Just in case more than one signal is triggered by the dialog so that
- // no more than one callback is sent to the native side.
+ // Prevents more than one callback being sent to the native
+ // side when the dialog triggers multiple events.
mDialogAlreadyDismissed = true;
Time time = new Time();
@@ -260,6 +255,6 @@ class InputDialogContainer {
time.monthDay = monthDay;
time.hour = hourOfDay;
time.minute = minute;
- mInputActionDelegate.replaceText(time.format(dateFormat));
+ mInputActionDelegate.replaceDateTime(time.format(dateFormat));
}
}

Powered by Google App Engine
This is Rietveld 408576698