OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.AlertDialog; | 7 import android.app.AlertDialog; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
10 import android.util.Log; | 10 import android.util.Log; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 confirm(mPrompTextView.getText().toString(), mSuppressCheckBox.isChecked
()); | 163 confirm(mPrompTextView.getText().toString(), mSuppressCheckBox.isChecked
()); |
164 mDialog.dismiss(); | 164 mDialog.dismiss(); |
165 } | 165 } |
166 | 166 |
167 public void onNegativeButtonClicked() { | 167 public void onNegativeButtonClicked() { |
168 cancel(mSuppressCheckBox.isChecked()); | 168 cancel(mSuppressCheckBox.isChecked()); |
169 mDialog.dismiss(); | 169 mDialog.dismiss(); |
170 } | 170 } |
171 | 171 |
172 void prepare(final ViewGroup layout) { | 172 void prepare(final ViewGroup layout) { |
173 // Display the checkbox for supressing dialogs if necessary. | 173 // Display the checkbox for suppressing dialogs if necessary. |
174 layout.findViewById(R.id.suppress_js_modal_dialogs).setVisibility( | 174 layout.findViewById(R.id.suppress_js_modal_dialogs).setVisibility( |
175 mShouldShowSuppressCheckBox ? View.VISIBLE : View.GONE); | 175 mShouldShowSuppressCheckBox ? View.VISIBLE : View.GONE); |
176 } | 176 } |
177 | 177 |
178 public void confirm(String promptResult, boolean suppressDialogs) { | 178 public void confirm(String promptResult, boolean suppressDialogs) { |
179 if (mNativeDialogPointer != 0) { | 179 if (mNativeDialogPointer != 0) { |
180 nativeDidAcceptAppModalDialog(mNativeDialogPointer, promptResult, su
ppressDialogs); | 180 nativeDidAcceptAppModalDialog(mNativeDialogPointer, promptResult, su
ppressDialogs); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 private native void nativeDidAcceptAppModalDialog(int nativeJavascriptAppMod
alDialogAndroid, | 276 private native void nativeDidAcceptAppModalDialog(int nativeJavascriptAppMod
alDialogAndroid, |
277 String prompt, boolean suppress); | 277 String prompt, boolean suppress); |
278 | 278 |
279 private native void nativeDidCancelAppModalDialog(int nativeJavascriptAppMod
alDialogAndroid, | 279 private native void nativeDidCancelAppModalDialog(int nativeJavascriptAppMod
alDialogAndroid, |
280 boolean suppress); | 280 boolean suppress); |
281 | 281 |
282 private static native JavascriptAppModalDialog nativeGetCurrentModalDialog()
; | 282 private static native JavascriptAppModalDialog nativeGetCurrentModalDialog()
; |
283 } | 283 } |
OLD | NEW |