diff options
author | Kristian Monsen <kristianm@google.com> | 2011-07-29 12:35:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-29 12:35:53 -0700 |
commit | 7bedcdc0a5df4cf4ce29aaf69a45eabf04490430 (patch) | |
tree | 1cab50fafabf90f1d9e18b0b4e5c1a3edae9a9c1 | |
parent | 3eee18782bb578265a87b400bcc2341a5777d887 (diff) | |
parent | 9eb0e892becc28d1f1ccbbdf2f36a6d5e9ee4145 (diff) | |
download | packages_apps_browser-7bedcdc0a5df4cf4ce29aaf69a45eabf04490430.zip packages_apps_browser-7bedcdc0a5df4cf4ce29aaf69a45eabf04490430.tar.gz packages_apps_browser-7bedcdc0a5df4cf4ce29aaf69a45eabf04490430.tar.bz2 |
Merge "Part of fix for bug 4997380: Some error types unknown to SslError"
-rw-r--r-- | res/values/strings.xml | 8 | ||||
-rw-r--r-- | src/com/android/browser/PageDialogsHandler.java | 41 |
2 files changed, 23 insertions, 26 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 56152da..41b9831 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -90,7 +90,13 @@ <string name="ssl_expired">This certificate has expired.</string> <!-- Message in an SSL Error dialog --> <string name="ssl_not_yet_valid">This certificate is not valid yet.</string> - + <!-- Message in an SSL Error dialog --> + <string name="ssl_date_invalid">This certificate has an invalid date.</string> + <!-- Message in an SSL Error dialog --> + <string name="ssl_invalid">This certificate is invalid.</string> + <!-- Message in an SSL Error dialog --> + <string name="ssl_unknown">Unknown certificate error.</string> + <!-- Toast informing the user that loading has stopped for the current page. --> <string name="stopping">Stopping\u2026</string> <!-- Menu item to stop the current page from loading. --> diff --git a/src/com/android/browser/PageDialogsHandler.java b/src/com/android/browser/PageDialogsHandler.java index 015a9bb..3f64758 100644 --- a/src/com/android/browser/PageDialogsHandler.java +++ b/src/com/android/browser/PageDialogsHandler.java @@ -306,32 +306,23 @@ public class PageDialogsHandler { final LinearLayout placeholder = (LinearLayout)certificateView.findViewById(com.android.internal.R.id.placeholder); - if (error.hasError(SslError.SSL_UNTRUSTED)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_untrusted); - } - - if (error.hasError(SslError.SSL_IDMISMATCH)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_mismatch); - } + LinearLayout ll = (LinearLayout)factory.inflate(R.layout.ssl_warning, placeholder); + TextView textView = (TextView)ll.findViewById(R.id.warning); - if (error.hasError(SslError.SSL_EXPIRED)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_expired); - } - - if (error.hasError(SslError.SSL_NOTYETVALID)) { - LinearLayout ll = (LinearLayout)factory - .inflate(R.layout.ssl_warning, placeholder); - ((TextView)ll.findViewById(R.id.warning)) - .setText(R.string.ssl_not_yet_valid); + if (error.hasError(SslError.SSL_UNTRUSTED)) { + textView.setText(R.string.ssl_untrusted); + } else if (error.hasError(SslError.SSL_IDMISMATCH)) { + textView.setText(R.string.ssl_mismatch); + } else if (error.hasError(SslError.SSL_EXPIRED)) { + textView.setText(R.string.ssl_expired); + } else if (error.hasError(SslError.SSL_NOTYETVALID)) { + textView.setText(R.string.ssl_not_yet_valid); + } else if (error.hasError(SslError.SSL_DATE_INVALID)) { + textView.setText(R.string.ssl_date_invalid); + } else if (error.hasError(SslError.SSL_INVALID)) { + textView.setText(R.string.ssl_invalid); + } else { + textView.setText(R.string.ssl_unknown); } mSSLCertificateOnErrorHandler = handler; |