From 62fc78754e1862880eebde3bc6afc3291295e55e Mon Sep 17 00:00:00 2001 From: jabarros Date: Tue, 9 Sep 2014 13:42:01 +0200 Subject: [PATCH] Changes after CR --- .../android/authentication/AuthenticatorActivity.java | 12 ++---------- .../owncloud/android/authentication/SsoWebViewClient.java | 2 +- .../android/ui/dialog/CredentialsDialogFragment.java | 8 ++++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index 716bf7fa..21aab72f 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -1697,14 +1697,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG); } - /** - * Show authentication dialog - */ - public void showAuthenticationDialog(WebView webView, HttpAuthHandler handler) { - // Show a dialog for the authentication - createAuthenticationDialog(webView, handler); - - } /** * Show untrusted cert dialog @@ -1798,11 +1790,11 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { } /** - * Create dialog for request authentication to the user + * Create and show dialog for request authentication to the user * @param webView * @param handler */ - private void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) { + public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) { // Show a dialog with the certificate info CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler); diff --git a/src/com/owncloud/android/authentication/SsoWebViewClient.java b/src/com/owncloud/android/authentication/SsoWebViewClient.java index b9b73199..fb078bdf 100644 --- a/src/com/owncloud/android/authentication/SsoWebViewClient.java +++ b/src/com/owncloud/android/authentication/SsoWebViewClient.java @@ -198,7 +198,7 @@ public class SsoWebViewClient extends WebViewClient { public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) { Log_OC.d(TAG, "onReceivedHttpAuthRequest : " + host); - ((AuthenticatorActivity)mContext).showAuthenticationDialog(view, handler); + ((AuthenticatorActivity)mContext).createAuthenticationDialog(view, handler); } @Override diff --git a/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java b/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java index 1b35057b..080316b8 100644 --- a/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java @@ -127,18 +127,18 @@ public class CredentialsDialogFragment extends SherlockDialogFragment public void onClick(DialogInterface dialog, int which) { if (which == AlertDialog.BUTTON_POSITIVE) { - String username = mUsernameET.getText().toString().trim(); - String password = mPasswordET.getText().toString().trim(); + String username = mUsernameET.getText().toString(); + String password = mPasswordET.getText().toString(); // Proceed with the authentication mHandler.proceed(username, password); - dialog.dismiss(); } else if (which == AlertDialog.BUTTON_NEGATIVE) { - dialog.dismiss(); mWebView.stopLoading(); ((AuthenticatorActivity)getActivity()).doNegativeAuthenticatioDialogClick(); } + + dialog.dismiss(); } -- 2.11.0