[haiku-webkit-commits] r377 - webkit/trunk/WebKit/haiku/WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Sat, 03 Apr 2010 12:45:23 +0000

Author: stippi
Date: Sat Apr  3 12:45:22 2010
New Revision: 377
URL: http://mmlr.dyndns.org/changeset/377

Log:
Made method that returns the tab index for a contained view public.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/WebTabView.cpp
   webkit/trunk/WebKit/haiku/WebPositive/WebTabView.h

Modified: webkit/trunk/WebKit/haiku/WebPositive/WebTabView.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/WebTabView.cpp        Fri Apr  2 
23:32:40 2010        (r376)
+++ webkit/trunk/WebKit/haiku/WebPositive/WebTabView.cpp        Sat Apr  3 
12:45:22 2010        (r377)
@@ -1318,6 +1318,19 @@
 }
 
 
+int32
+TabManager::TabForView(const BView* containedView) const
+{
+       int32 count = fCardLayout->CountItems();
+       for (int32 i = 0; i < count; i++) {
+               BLayoutItem* item = fCardLayout->ItemAt(i);
+               if (item->View() == containedView)
+                       return i;
+       }
+       return -1;
+}
+
+
 void
 TabManager::SelectTab(int32 tabIndex)
 {
@@ -1333,7 +1346,7 @@
 void
 TabManager::SelectTab(const BView* containedView)
 {
-       int32 tabIndex = _TabIndexForContainedView(containedView);
+       int32 tabIndex = TabForView(containedView);
        if (tabIndex > 0)
                SelectTab(tabIndex);
 }
@@ -1401,7 +1414,7 @@
 TabManager::SetTabIcon(const BView* containedView, const BBitmap* icon)
 {
        WebTabView* tab = dynamic_cast<WebTabView*>(fTabContainerView->TabAt(
-               _TabIndexForContainedView(containedView)));
+               TabForView(containedView)));
        if (tab)
                tab->SetIcon(icon);
 }
@@ -1417,15 +1430,3 @@
 }
 
 
-int32
-TabManager::_TabIndexForContainedView(const BView* containedView) const
-{
-       int32 count = fCardLayout->CountItems();
-       for (int32 i = 0; i < count; i++) {
-               BLayoutItem* item = fCardLayout->ItemAt(i);
-               if (item->View() == containedView)
-                       return i;
-       }
-       return -1;
-}
-

Modified: webkit/trunk/WebKit/haiku/WebPositive/WebTabView.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/WebTabView.h  Fri Apr  2 23:32:40 
2010        (r376)
+++ webkit/trunk/WebKit/haiku/WebPositive/WebTabView.h  Sat Apr  3 12:45:22 
2010        (r377)
@@ -60,6 +60,7 @@
                        BView*                          ContainerView() const;
 
                        BView*                          ViewForTab(int32 
tabIndex) const;
+                       int32                           TabForView(const BView* 
containedView) const;
 
                        void                            SelectTab(int32 
tabIndex);
                        void                            SelectTab(const BView* 
containedView);
@@ -77,10 +78,6 @@
                        void                            
SetCloseButtonsAvailable(bool available);
 
 private:
-                       int32                           
_TabIndexForContainedView(
-                                                                       const 
BView* containedView) const;
-
-private:
 #if INTEGRATE_MENU_INTO_TAB_BAR
                        BMenu*                          fMenu;
 #endif

Other related posts:

  • » [haiku-webkit-commits] r377 - webkit/trunk/WebKit/haiku/WebPositive - webkit