Index: content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java |
index fffe130ff1e613b68b6bf17a4452b5cedbe1d800..bca0f01b39ea86a09228f2609fa261fbfba54414 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java |
@@ -168,13 +168,7 @@ public class InputDialogContainer { |
mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, |
mContext.getText(android.R.string.cancel), |
- new DialogInterface.OnClickListener() { |
- @Override |
- public void onClick(DialogInterface dialog, int which) { |
- mDialogAlreadyDismissed = true; |
- mInputActionDelegate.cancelDateTimeDialog(); |
- } |
- }); |
+ (DialogInterface.OnClickListener) null); |
mDialog.setButton(DialogInterface.BUTTON_NEUTRAL, |
mContext.getText(R.string.date_picker_dialog_clear), |
@@ -186,6 +180,16 @@ public class InputDialogContainer { |
} |
}); |
+ mDialog.setOnDismissListener( |
+ new OnDismissListener() { |
+ public void onDismiss(final DialogInterface dialog) { |
+ if (!mDialogAlreadyDismissed) { |
+ mDialogAlreadyDismissed = true; |
+ mInputActionDelegate.cancelDateTimeDialog(); |
+ } |
+ } |
+ }); |
+ |
mDialogAlreadyDismissed = false; |
mDialog.show(); |
} |