Fix cancel on touch outside in AppModalPresenter

TBR=twellington@chromium.org

Bug: 924877
Change-Id: Iacc7dbca1c2166cc9219ebaa4153ab0e52546053
Reviewed-on: https://chromium-review.googlesource.com/c/1435494
Reviewed-by: Theresa <twellington@chromium.org>
Commit-Queue: Becky Zhou <huayinz@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#626143}(cherry picked from commit ef448d714c00d5f3169ba90f0baf557fd86cb345)
Reviewed-on: https://chromium-review.googlesource.com/c/1447692
Reviewed-by: Becky Zhou <huayinz@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#86}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/AppModalPresenter.java b/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/AppModalPresenter.java
index 51abadc..13382d5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/AppModalPresenter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/AppModalPresenter.java
@@ -44,7 +44,9 @@
         mDialog = new Dialog(mContext, R.style.ModalDialogTheme);
         mDialog.setOnCancelListener(dialogInterface
                 -> dismissCurrentDialog(DialogDismissalCause.NAVIGATE_BACK_OR_TOUCH_OUTSIDE));
-
+        // Cancel on touch outside should be disabled by default. The ModelChangeProcessor wouldn't
+        // notify change if the property is not set during initialization.
+        mDialog.setCanceledOnTouchOutside(false);
         ModalDialogView dialogView = (ModalDialogView) LayoutInflater.from(mDialog.getContext())
                                              .inflate(R.layout.modal_dialog_view, null);
         mModelChangeProcessor =