summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Tab.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-08-26 17:39:44 -0700
committerJohn Reck <jreck@google.com>2011-08-26 17:41:02 -0700
commitcb28b2cfe64bb1b8e1fe379aa59bf1b0e93ae790 (patch)
treeb08b6d0fa13e1d9855343d81a37d0187211dabd1 /src/com/android/browser/Tab.java
parent904a8bd6faf1965097b4f264595e654a33ac2086 (diff)
downloadpackages_apps_browser-cb28b2cfe64bb1b8e1fe379aa59bf1b0e93ae790.zip
packages_apps_browser-cb28b2cfe64bb1b8e1fe379aa59bf1b0e93ae790.tar.gz
packages_apps_browser-cb28b2cfe64bb1b8e1fe379aa59bf1b0e93ae790.tar.bz2
Security warning dialog update
Bug: 5222843 Change-Id: I0d387a0564c82e1234ea14dee723a52e1ba9cade
Diffstat (limited to 'src/com/android/browser/Tab.java')
-rw-r--r--src/com/android/browser/Tab.java68
1 files changed, 19 insertions, 49 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index d6106a5..c519c91 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -744,75 +744,45 @@ class Tab implements PictureListener {
return;
}
if (mSettings.showSecurityWarnings()) {
- final LayoutInflater factory =
- LayoutInflater.from(mContext);
- final View warningsView =
- factory.inflate(R.layout.ssl_warnings, null);
- final LinearLayout placeholder =
- (LinearLayout)warningsView.findViewById(R.id.placeholder);
-
- if (error.hasError(SslError.SSL_UNTRUSTED)) {
- LinearLayout ll = (LinearLayout)factory
- .inflate(R.layout.ssl_warning, null);
- ((TextView)ll.findViewById(R.id.warning))
- .setText(R.string.ssl_untrusted);
- placeholder.addView(ll);
- }
-
- if (error.hasError(SslError.SSL_IDMISMATCH)) {
- LinearLayout ll = (LinearLayout)factory
- .inflate(R.layout.ssl_warning, null);
- ((TextView)ll.findViewById(R.id.warning))
- .setText(R.string.ssl_mismatch);
- placeholder.addView(ll);
- }
-
- if (error.hasError(SslError.SSL_EXPIRED)) {
- LinearLayout ll = (LinearLayout)factory
- .inflate(R.layout.ssl_warning, null);
- ((TextView)ll.findViewById(R.id.warning))
- .setText(R.string.ssl_expired);
- placeholder.addView(ll);
- }
-
- if (error.hasError(SslError.SSL_NOTYETVALID)) {
- LinearLayout ll = (LinearLayout)factory
- .inflate(R.layout.ssl_warning, null);
- ((TextView)ll.findViewById(R.id.warning))
- .setText(R.string.ssl_not_yet_valid);
- placeholder.addView(ll);
- }
-
- new AlertDialog.Builder(mContext).setTitle(
- R.string.security_warning).setIcon(
- android.R.drawable.ic_dialog_alert).setView(
- warningsView).setPositiveButton(R.string.ssl_continue,
+ new AlertDialog.Builder(mContext)
+ .setTitle(R.string.security_warning)
+ .setMessage(R.string.ssl_warnings_header)
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setPositiveButton(R.string.ssl_continue,
new DialogInterface.OnClickListener() {
+ @Override
public void onClick(DialogInterface dialog,
int whichButton) {
handler.proceed();
}
- }).setNeutralButton(R.string.view_certificate,
+ })
+ .setNeutralButton(R.string.view_certificate,
new DialogInterface.OnClickListener() {
+ @Override
public void onClick(DialogInterface dialog,
int whichButton) {
- mWebViewController.showSslCertificateOnError(view,
- handler, error);
+ mWebViewController.showSslCertificateOnError(
+ view, handler, error);
}
- }).setNegativeButton(R.string.ssl_go_back,
+ })
+ .setNegativeButton(R.string.ssl_go_back,
new DialogInterface.OnClickListener() {
+ @Override
public void onClick(DialogInterface dialog,
int whichButton) {
dialog.cancel();
}
- }).setOnCancelListener(
+ })
+ .setOnCancelListener(
new DialogInterface.OnCancelListener() {
+ @Override
public void onCancel(DialogInterface dialog) {
handler.cancel();
setLockIconType(LockIcon.LOCK_ICON_UNSECURE);
mWebViewController.onUserCanceledSsl(Tab.this);
}
- }).show();
+ })
+ .show();
} else {
handler.proceed();
}