[haiku-webkit-commits] r235 - in webkit/trunk/WebKit/haiku: API HaikuLauncher

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Sat, 27 Feb 2010 13:20:24 +0000

Author: stippi
Date: Sat Feb 27 13:20:24 2010
New Revision: 235
URL: http://mmlr.dyndns.org/changeset/235

Log:
Hide the implementation details of BWebWindow::AuthenticationChallenge() from
clients.

Modified:
   webkit/trunk/WebKit/haiku/API/WebWindow.cpp
   webkit/trunk/WebKit/haiku/API/WebWindow.h
   webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.cpp
   webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.h

Modified: webkit/trunk/WebKit/haiku/API/WebWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebWindow.cpp Sat Feb 27 13:09:57 2010        
(r234)
+++ webkit/trunk/WebKit/haiku/API/WebWindow.cpp Sat Feb 27 13:20:24 2010        
(r235)
@@ -170,7 +170,28 @@
         break;
     }
     case AUTHENTICATION_CHALLENGE: {
-        AuthenticationChallenge(message);
+           BString text;
+           bool rememberCredentials = false;
+           uint32 failureCount = 0;
+           BString user;
+           BString password;
+       
+           message->FindString("text", &text);
+           message->FindString("user", &user);
+           message->FindString("password", &password);
+           message->FindUInt32("failureCount", &failureCount);
+
+        if (!AuthenticationChallenge(text, user, password, rememberCredentials,
+                       failureCount)) {
+               message->SendReply((uint32)0);
+               break;
+        }
+
+           BMessage reply;
+           reply.AddString("user", user);
+           reply.AddString("password", password);
+           reply.AddBool("rememberCredentials", rememberCredentials);
+           message->SendReply(&reply);
         break;
     }
 
@@ -314,8 +335,10 @@
 {
 }
 
-void BWebWindow::AuthenticationChallenge(BMessage* challenge)
+bool BWebWindow::AuthenticationChallenge(BString message, BString& inOutUser,
+       BString& inOutPassword, bool& inOutRememberCredentials, uint32 
failureCount)
 {
+       return false;
 }
 
 // #pragma mark - private

Modified: webkit/trunk/WebKit/haiku/API/WebWindow.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebWindow.h   Sat Feb 27 13:09:57 2010        
(r234)
+++ webkit/trunk/WebKit/haiku/API/WebWindow.h   Sat Feb 27 13:20:24 2010        
(r235)
@@ -80,7 +80,10 @@
                                                                        bool 
canGoBackward, bool canGoForward,
                                                                        bool 
canStop, BWebView* view);
        virtual void                            UpdateGlobalHistory(const 
BString& url);
-       virtual void                            
AuthenticationChallenge(BMessage* challenge);
+       virtual bool                            AuthenticationChallenge(BString 
message,
+                                                                       
BString& inOutUser, BString& inOutPassword,
+                                                                       bool& 
inOutRememberCredentials,
+                                                                       uint32 
failureCount);
 
 private:
                        BWebView*                       _WebViewForMessage(

Modified: webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.cpp  Sat Feb 27 
13:09:57 2010        (r234)
+++ webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.cpp  Sat Feb 27 
13:20:24 2010        (r235)
@@ -653,31 +653,14 @@
     BrowsingHistory::defaultInstance()->addItem(BrowsingHistoryItem(url));
 }
 
-void LauncherWindow::AuthenticationChallenge(BMessage* message)
+bool LauncherWindow::AuthenticationChallenge(BString message, BString& 
inOutUser,
+       BString& inOutPassword, bool& inOutRememberCredentials, uint32 
failureCount)
 {
-    BString text;
-    bool rememberCredentials = false;
-    uint32 failureCount = 0;
-    BString user;
-    BString password;
-
-    message->FindString("text", &text);
-    message->FindString("user", &user);
-    message->FindString("password", &password);
-    message->FindUInt32("failureCount", &failureCount);
-
     AuthenticationPanel* panel = new AuthenticationPanel(Frame());
-    if (!panel->getAuthentication(text, user, password, rememberCredentials,
-            failureCount > 0, user, password, &rememberCredentials)) {
-        message->SendReply((uint32)0);
-        return;
-    }
-
-    BMessage reply;
-    reply.AddString("user", user);
-    reply.AddString("password", password);
-    reply.AddBool("rememberCredentials", rememberCredentials);
-    message->SendReply(&reply);
+       // Panel auto-destructs.
+    return panel->getAuthentication(message, inOutUser, inOutPassword,
+               inOutRememberCredentials, failureCount > 0, inOutUser, 
inOutPassword,
+               &inOutRememberCredentials);
 }
 
 void LauncherWindow::updateTitle(const BString& title)

Modified: webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.h
==============================================================================
--- webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.h    Sat Feb 27 
13:09:57 2010        (r234)
+++ webkit/trunk/WebKit/haiku/HaikuLauncher/LauncherWindow.h    Sat Feb 27 
13:20:24 2010        (r235)
@@ -91,7 +91,9 @@
     virtual void NavigationCapabilitiesChanged(bool canGoBackward,
         bool canGoForward, bool canStop, BWebView* view);
     virtual void UpdateGlobalHistory(const BString& url);
-    virtual void AuthenticationChallenge(BMessage* challenge);
+       virtual bool AuthenticationChallenge(BString message, BString& 
inOutUser,
+               BString& inOutPassword, bool& inOutRememberCredentials,
+               uint32 failureCount);
 
     void updateTitle(const BString &title);
     void updateTabGroupVisibility();

Other related posts:

  • » [haiku-webkit-commits] r235 - in webkit/trunk/WebKit/haiku: API HaikuLauncher - webkit