diff options
author | Huahui Wu <hwu@google.com> | 2011-06-28 10:17:05 -0700 |
---|---|---|
committer | Huahui Wu <hwu@google.com> | 2011-06-28 12:29:18 -0700 |
commit | ae0c0411bb502976c6374e30c5d1aa4271a64daf (patch) | |
tree | 194499f4ae01383eedbe0cb2cc353f815774fc6b /src | |
parent | 4a7794c4d4db046357647f4b435d711be7b9eeaa (diff) | |
download | packages_apps_Browser-ae0c0411bb502976c6374e30c5d1aa4271a64daf.zip packages_apps_Browser-ae0c0411bb502976c6374e30c5d1aa4271a64daf.tar.gz packages_apps_Browser-ae0c0411bb502976c6374e30c5d1aa4271a64daf.tar.bz2 |
2nd try: Shows the right URL that has a cert error.
Identical to https://android-git.corp.google.com/g/#change,117835
which was reverted since its collaborative CL broke the build.
Change-Id: Ic0344bd30895700692fbf7cec84666567133e103
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 c902f65..b39d863 100644 --- a/src/com/android/browser/PageDialogsHandler.java +++ b/src/com/android/browser/PageDialogsHandler.java @@ -39,6 +39,7 @@ public class PageDialogsHandler { private Context mContext; private Controller mController; private boolean mPageInfoFromShowSSLCertificateOnError; + private String mUrlCertificateOnError; private Tab mPageInfoView; private AlertDialog mPageInfoDialog; @@ -63,7 +64,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(); @@ -71,8 +74,9 @@ public class PageDialogsHandler { } if (mSSLCertificateOnErrorDialog != null) { mSSLCertificateOnErrorDialog.dismiss(); - showSSLCertificateOnError(mSSLCertificateOnErrorView, mSSLCertificateOnErrorHandler, - mSSLCertificateOnErrorError); + showSSLCertificateOnError(mSSLCertificateOnErrorView, + mSSLCertificateOnErrorHandler, + mSSLCertificateOnErrorError); } if (mHttpAuthenticationDialog != null) { mHttpAuthenticationDialog.reshow(); @@ -126,16 +130,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) { @@ -150,6 +157,7 @@ public class PageDialogsHandler { mPageInfoView = tab; mPageInfoFromShowSSLCertificateOnError = fromShowSSLCertificateOnError; + mUrlCertificateOnError = urlCertificateOnError; AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext) @@ -261,7 +269,7 @@ public class PageDialogsHandler { mSSLCertificateDialog = null; mSSLCertificateView = null; - showPageInfo(tab, false); + showPageInfo(tab, false, null); } }) .setOnCancelListener( @@ -270,7 +278,7 @@ public class PageDialogsHandler { mSSLCertificateDialog = null; mSSLCertificateView = null; - showPageInfo(tab, false); + showPageInfo(tab, false, null); } }) .show(); @@ -359,7 +367,8 @@ public class PageDialogsHandler { showPageInfo(mController.getTabControl() .getTabFromView(view), - true); + true, + error.getUrl()); } }) .setOnCancelListener( |