Browse Source

Changes after CR

jabarros 10 years ago
parent
commit
62fc78754e

+ 2 - 10
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);

+ 1 - 1
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

+ 4 - 4
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();
     }