diff options
author | Huahui Wu <hwu@google.com> | 2011-06-27 11:16:07 -0700 |
---|---|---|
committer | Huahui Wu <hwu@google.com> | 2011-06-27 11:41:36 -0700 |
commit | db6ff8999159f386ea8a99d980ce533b717fca78 (patch) | |
tree | af833b9619eafd1aa7752925960b1cf4cb6999d8 /src | |
parent | 7035ce16de00315ed10784f83c76e924f124cebd (diff) | |
download | packages_apps_Browser-db6ff8999159f386ea8a99d980ce533b717fca78.zip packages_apps_Browser-db6ff8999159f386ea8a99d980ce533b717fca78.tar.gz packages_apps_Browser-db6ff8999159f386ea8a99d980ce533b717fca78.tar.bz2 |
Shows the right URL that has a cert error.
b/2689122 SSL error shows the wrong page when triggered by an image/javascript in the page
This CL receives the URL which has a invalid cert from framework and shows it in related
dialogues. Related CLs are:
webkit: https://android-git.corp.google.com/g/#change,117817
framework: https://android-git.corp.google.com/g/#change,117828
Change-Id: I9b243b73b9cce19d94cc71608207219bfa687db2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Controller.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/PageDialogsHandler.java | 25 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 9a015b2..7abda69 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1694,8 +1694,7 @@ public class Controller break; case R.id.page_info_menu_id: - mPageDialogsHandler.showPageInfo(mTabControl.getCurrentTab(), - false); + mPageDialogsHandler.showPageInfo(mTabControl.getCurrentTab(), false, null); break; case R.id.classic_history_menu_id: diff --git a/src/com/android/browser/PageDialogsHandler.java b/src/com/android/browser/PageDialogsHandler.java index 2dbddf3..b9e0859 100644 --- a/src/com/android/browser/PageDialogsHandler.java +++ b/src/com/android/browser/PageDialogsHandler.java @@ -42,6 +42,7 @@ public class PageDialogsHandler { private Context mContext; private Controller mController; private boolean mPageInfoFromShowSSLCertificateOnError; + private String mUrlCertificateOnError; private Tab mPageInfoView; private AlertDialog mPageInfoDialog; @@ -66,7 +67,9 @@ public class PageDialogsHandler { public void onConfigurationChanged(Configuration config) { if (mPageInfoDialog != null) { mPageInfoDialog.dismiss(); - showPageInfo(mPageInfoView, mPageInfoFromShowSSLCertificateOnError); + showPageInfo(mPageInfoView, + mPageInfoFromShowSSLCertificateOnError, + mUrlCertificateOnError); } if (mSSLCertificateDialog != null) { mSSLCertificateDialog.dismiss(); @@ -74,8 +77,9 @@ public class PageDialogsHandler { } if (mSSLCertificateOnErrorDialog != null) { mSSLCertificateOnErrorDialog.dismiss(); - showSSLCertificateOnError(mSSLCertificateOnErrorView, mSSLCertificateOnErrorHandler, - mSSLCertificateOnErrorError); + showSSLCertificateOnError(mSSLCertificateOnErrorView, + mSSLCertificateOnErrorHandler, + mSSLCertificateOnErrorError); } if (mHttpAuthenticationDialog != null) { mHttpAuthenticationDialog.reshow(); @@ -129,16 +133,19 @@ public class PageDialogsHandler { * this dialog was opened from the SSL-certificate-on-error dialog or * not. This is important, since we need to know whether to return to * the parent dialog or simply dismiss. + * @param urlCertificateOnError The URL that invokes SSLCertificateError. + * Null when fromShowSSLCertificateOnError is false. */ void showPageInfo(final Tab tab, - final boolean fromShowSSLCertificateOnError) { + final boolean fromShowSSLCertificateOnError, + final String urlCertificateOnError) { final LayoutInflater factory = LayoutInflater.from(mContext); final View pageInfoView = factory.inflate(R.layout.page_info, null); final WebView view = tab.getWebView(); - String url = tab.getUrl(); + String url = fromShowSSLCertificateOnError ? urlCertificateOnError : tab.getUrl(); String title = tab.getTitle(); if (url == null) { @@ -153,6 +160,7 @@ public class PageDialogsHandler { mPageInfoView = tab; mPageInfoFromShowSSLCertificateOnError = fromShowSSLCertificateOnError; + mUrlCertificateOnError = urlCertificateOnError; AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext) @@ -263,7 +271,7 @@ public class PageDialogsHandler { mSSLCertificateDialog = null; mSSLCertificateView = null; - showPageInfo(tab, false); + showPageInfo(tab, false, null); } }) .setOnCancelListener( @@ -272,7 +280,7 @@ public class PageDialogsHandler { mSSLCertificateDialog = null; mSSLCertificateView = null; - showPageInfo(tab, false); + showPageInfo(tab, false, null); } }) .show(); @@ -361,7 +369,8 @@ public class PageDialogsHandler { showPageInfo(mController.getTabControl() .getTabFromView(view), - true); + true, + error.getUrl()); } }) .setOnCancelListener( |