[haiku-webkit-commits] r383 - webkit/trunk/WebKit/haiku/API

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Sun, 04 Apr 2010 12:04:31 +0000

Author: stippi
Date: Sun Apr  4 12:04:31 2010
New Revision: 383
URL: http://mmlr.dyndns.org/changeset/383

Log:
Always automatically focus the BWebView after firing a load request. This
behavior is the same in Firefox and allows to use the keyboard to navigate in
the new page right away.

Modified:
   webkit/trunk/WebKit/haiku/API/WebView.cpp
   webkit/trunk/WebKit/haiku/API/WebView.h

Modified: webkit/trunk/WebKit/haiku/API/WebView.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebView.cpp   Sat Apr  3 19:49:12 2010        
(r382)
+++ webkit/trunk/WebKit/haiku/API/WebView.cpp   Sun Apr  4 12:04:31 2010        
(r383)
@@ -242,9 +242,13 @@
     return fWebPage->MainFrameURL();
 }
 
-void BWebView::LoadURL(const char* urlString)
+void BWebView::LoadURL(const char* urlString, bool aquireFocus)
 {
     fWebPage->LoadURL(urlString);
+       // Always focus the web view after firing off a load request.
+       // This behavior is also observed in Firefox.
+       if (aquireFocus && !IsFocus())
+               MakeFocus(true);
 }
 
 void BWebView::Reload()

Modified: webkit/trunk/WebKit/haiku/API/WebView.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebView.h     Sat Apr  3 19:49:12 2010        
(r382)
+++ webkit/trunk/WebKit/haiku/API/WebView.h     Sun Apr  4 12:04:31 2010        
(r383)
@@ -74,7 +74,8 @@
                        BString                         MainFrameRequestedURL() 
const;
                        BString                         MainFrameURL() const;
 
-                       void                            LoadURL(const char* 
urlString);
+                       void                            LoadURL(const char* 
urlString,
+                                                                       bool 
aquireFocus = true);
                        void                            Reload();
                        void                            GoBack();
                        void                            GoForward();

Other related posts:

  • » [haiku-webkit-commits] r383 - webkit/trunk/WebKit/haiku/API - webkit