| Index: chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
|
| diff --git a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
|
| index 8a75a3bbbcb152a65735ca681a692a5f85df6a65..dd58decac411288f177c16c6b634e5596ef4b8d1 100644
|
| --- a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
|
| +++ b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
|
| @@ -39,15 +39,6 @@ JavascriptAppModalDialogAndroid::JavascriptAppModalDialogAndroid(
|
| parent_jobject_weak_ref_(env, parent->GetJavaObject().obj()) {
|
| }
|
|
|
| -JavascriptAppModalDialogAndroid::~JavascriptAppModalDialogAndroid() {
|
| - JNIEnv* env = AttachCurrentThread();
|
| - // In case the dialog is still displaying, tell it to close itself.
|
| - // This can happen if you trigger a dialog but close the Tab before it's
|
| - // shown, and then accept the dialog.
|
| - if (!dialog_jobject_.is_null())
|
| - Java_JavascriptAppModalDialog_dismiss(env, dialog_jobject_.obj());
|
| -}
|
| -
|
| int JavascriptAppModalDialogAndroid::GetAppModalDialogButtons() const {
|
| NOTIMPLEMENTED();
|
| return 0;
|
| @@ -163,3 +154,12 @@ bool JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog(
|
| JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
| }
|
| +
|
| +JavascriptAppModalDialogAndroid::~JavascriptAppModalDialogAndroid() {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + // In case the dialog is still displaying, tell it to close itself.
|
| + // This can happen if you trigger a dialog but close the Tab before it's
|
| + // shown, and then accept the dialog.
|
| + if (!dialog_jobject_.is_null())
|
| + Java_JavascriptAppModalDialog_dismiss(env, dialog_jobject_.obj());
|
| +}
|
|
|