Bug 669028 part.12 layout/xul should use mozilla::LookAndFeel rather than nsILookAndFeel r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 09 Sep 2011 11:27:13 +0900
changeset 76818 36da7ff7039c54ecc28c3968f02166c5bf5978ab
parent 76817 b81bce473c10154f0d2fb97852c9ebc1ed481512
child 76819 8f20dc5f4c8fe4384be9f9dc9f04a01b3b8d3bd6
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs669028
milestone9.0a1
Bug 669028 part.12 layout/xul should use mozilla::LookAndFeel rather than nsILookAndFeel r=roc
layout/xul/base/src/nsMenuFrame.cpp
layout/xul/base/src/nsMenuPopupFrame.cpp
layout/xul/base/src/nsScrollbarButtonFrame.cpp
layout/xul/base/src/nsSliderFrame.cpp
layout/xul/base/src/nsSplitterFrame.cpp
layout/xul/base/src/nsXULPopupManager.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.h
--- a/layout/xul/base/src/nsMenuFrame.cpp
+++ b/layout/xul/base/src/nsMenuFrame.cpp
@@ -50,19 +50,17 @@
 #include "nsIPresShell.h"
 #include "nsStyleContext.h"
 #include "nsCSSRendering.h"
 #include "nsINameSpaceManager.h"
 #include "nsMenuPopupFrame.h"
 #include "nsMenuBarFrame.h"
 #include "nsIDocument.h"
 #include "nsIDOMElement.h"
-#include "nsILookAndFeel.h"
 #include "nsIComponentManager.h"
-#include "nsWidgetsCID.h"
 #include "nsBoxLayoutState.h"
 #include "nsIScrollableFrame.h"
 #include "nsBindingManager.h"
 #include "nsIServiceManager.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsIPrivateDOMEvent.h"
@@ -74,29 +72,28 @@
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
 #include "nsIReflowCallback.h"
 #include "nsISound.h"
 #include "nsEventStateManager.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/LookAndFeel.h"
 
 using namespace mozilla;
 
 #define NS_MENU_POPUP_LIST_INDEX 0
 
 #if defined(XP_WIN) || defined(XP_OS2)
 #define NSCONTEXTMENUISMOUSEUP 1
 #endif
 
 static PRInt32 gEatMouseMove = PR_FALSE;
 
-static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
-
 const PRInt32 kBlinkDelay = 67; // milliseconds
 
 // this class is used for dispatching menu activation events asynchronously.
 class nsMenuActivateEvent : public nsRunnable
 {
 public:
   nsMenuActivateEvent(nsIContent *aMenu,
                       nsPresContext* aPresContext,
@@ -515,21 +512,18 @@ nsMenuFrame::HandleEvent(nsPresContext* 
       return NS_OK;
     }
 
     // Hovering over a menu in a popup should open it without a need for a click.
     // A timer is used so that it doesn't open if the user moves the mouse quickly
     // past the menu. This conditional check ensures that only menus have this
     // behaviour
     if (!IsDisabled() && IsMenu() && !IsOpen() && !mOpenTimer && !mMenuParent->IsMenuBar()) {
-      PRInt32 menuDelay = 300;   // ms
-
-      nsCOMPtr<nsILookAndFeel> lookAndFeel(do_GetService(kLookAndFeelCID));
-      if (lookAndFeel)
-        lookAndFeel->GetMetric(nsILookAndFeel::eMetric_SubmenuDelay, menuDelay);
+      PRInt32 menuDelay =
+        LookAndFeel::GetInt(LookAndFeel::eIntID_SubmenuDelay, 300); // ms
 
       // We're a menu, we're built, we're closed, and no timer has been kicked off.
       mOpenTimer = do_CreateInstance("@mozilla.org/timer;1");
       mOpenTimer->InitWithCallback(mTimerMediator, menuDelay, nsITimer::TYPE_ONE_SHOT);
     }
   }
   
   return NS_OK;
@@ -1156,21 +1150,18 @@ nsMenuFrame::Execute(nsGUIEvent *aEvent)
     sound->PlayEventSound(nsISound::EVENT_MENU_EXECUTE);
 
   StartBlinking(aEvent, needToFlipChecked);
 }
 
 PRBool
 nsMenuFrame::ShouldBlink()
 {
-  PRInt32 shouldBlink = 0;
-  nsCOMPtr<nsILookAndFeel> lookAndFeel(do_GetService(kLookAndFeelCID));
-  if (lookAndFeel) {
-    lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ChosenMenuItemsShouldBlink, shouldBlink);
-  }
+  PRInt32 shouldBlink =
+    LookAndFeel::GetInt(LookAndFeel::eIntID_ChosenMenuItemsShouldBlink, 0);
   if (!shouldBlink)
     return PR_FALSE;
 
   // Don't blink in editable menulists.
   if (GetParentMenuListType() == eEditableMenuList)
     return PR_FALSE;
 
   return PR_TRUE;
--- a/layout/xul/base/src/nsMenuPopupFrame.cpp
+++ b/layout/xul/base/src/nsMenuPopupFrame.cpp
@@ -56,17 +56,16 @@
 #include "nsPopupSetFrame.h"
 #include "nsEventDispatcher.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMScreen.h"
 #include "nsIPresShell.h"
 #include "nsFrameManager.h"
 #include "nsIDocument.h"
 #include "nsRect.h"
-#include "nsILookAndFeel.h"
 #include "nsIComponentManager.h"
 #include "nsBoxLayoutState.h"
 #include "nsIScrollableFrame.h"
 #include "nsGUIEvent.h"
 #include "nsIRootBox.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
@@ -82,16 +81,17 @@
 #include "nsIBaseWindow.h"
 #include "nsISound.h"
 #include "nsIRootBox.h"
 #include "nsIScreenManager.h"
 #include "nsIServiceManager.h"
 #include "nsThemeConstants.h"
 #include "nsDisplayList.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/LookAndFeel.h"
 
 using namespace mozilla;
 
 PRInt8 nsMenuPopupFrame::sDefaultLevelIsTop = -1;
 
 // NS_NewMenuPopupFrame
 //
 // Wrapper for creating a new menu popup container
@@ -145,20 +145,18 @@ nsMenuPopupFrame::Init(nsIContent*      
 {
   nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsPresContext* presContext = PresContext();
 
   // lookup if we're allowed to overlap the OS bar (menubar/taskbar) from the
   // look&feel object
-  PRInt32 tempBool;
-  presContext->LookAndFeel()->
-    GetMetric(nsILookAndFeel::eMetric_MenusCanOverlapOSBar, tempBool);
-  mMenuCanOverlapOSBar = tempBool;
+  mMenuCanOverlapOSBar =
+    LookAndFeel::GetInt(LookAndFeel::eIntID_MenusCanOverlapOSBar) != 0;
 
   rv = CreatePopupViewForFrame();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // XXX Hack. The popup's view should float above all other views,
   // so we use the nsIView::SetFloating() to tell the view manager
   // about that constraint.
   nsIView* ourView = GetView();
--- a/layout/xul/base/src/nsScrollbarButtonFrame.cpp
+++ b/layout/xul/base/src/nsScrollbarButtonFrame.cpp
@@ -48,17 +48,19 @@
 #include "nsCOMPtr.h"
 #include "nsINameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsSliderFrame.h"
 #include "nsScrollbarFrame.h"
 #include "nsIScrollbarMediator.h"
 #include "nsRepeatService.h"
 #include "nsGUIEvent.h"
-#include "nsILookAndFeel.h"
+#include "mozilla/LookAndFeel.h"
+
+using namespace mozilla;
 
 //
 // NS_NewToolbarFrame
 //
 // Creates a new Toolbar frame and returns it
 //
 nsIFrame*
 NS_NewScrollbarButtonFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
@@ -95,38 +97,38 @@ nsScrollbarButtonFrame::HandleEvent(nsPr
 
 
 PRBool
 nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext, 
                                           nsGUIEvent*     aEvent,
                                           nsEventStatus*  aEventStatus)
 {
   // Get the desired action for the scrollbar button.
-  nsILookAndFeel::nsMetricID tmpAction;
+  LookAndFeel::IntID tmpAction;
   if (aEvent->eventStructType == NS_MOUSE_EVENT &&
       aEvent->message == NS_MOUSE_BUTTON_DOWN) {
     PRUint16 button = static_cast<nsMouseEvent*>(aEvent)->button;
     if (button == nsMouseEvent::eLeftButton) {
-      tmpAction = nsILookAndFeel::eMetric_ScrollButtonLeftMouseButtonAction;
+      tmpAction = LookAndFeel::eIntID_ScrollButtonLeftMouseButtonAction;
     } else if (button == nsMouseEvent::eMiddleButton) {
-      tmpAction = nsILookAndFeel::eMetric_ScrollButtonMiddleMouseButtonAction;
+      tmpAction = LookAndFeel::eIntID_ScrollButtonMiddleMouseButtonAction;
     } else if (button == nsMouseEvent::eRightButton) {
-      tmpAction = nsILookAndFeel::eMetric_ScrollButtonRightMouseButtonAction;
+      tmpAction = LookAndFeel::eIntID_ScrollButtonRightMouseButtonAction;
     } else {
       return PR_FALSE;
     }
   } else {
     return PR_FALSE;
   }
 
   // Get the button action metric from the pres. shell.
   PRInt32 pressedButtonAction;
-  if (NS_FAILED(aPresContext->LookAndFeel()->GetMetric(tmpAction,
-                                                       pressedButtonAction)))
+  if (NS_FAILED(LookAndFeel::GetInt(tmpAction, &pressedButtonAction))) {
     return PR_FALSE;
+  }
 
   // get the scrollbar control
   nsIFrame* scrollbar;
   GetParentWithTag(nsGkAtoms::scrollbar, this, scrollbar);
 
   if (scrollbar == nsnull)
     return PR_FALSE;
 
--- a/layout/xul/base/src/nsSliderFrame.cpp
+++ b/layout/xul/base/src/nsSliderFrame.cpp
@@ -56,26 +56,26 @@
 #include "nsCSSRendering.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDocument.h"
 #include "nsScrollbarButtonFrame.h"
 #include "nsISliderListener.h"
 #include "nsIScrollbarMediator.h"
 #include "nsScrollbarFrame.h"
-#include "nsILookAndFeel.h"
 #include "nsRepeatService.h"
 #include "nsBoxLayoutState.h"
 #include "nsSprocketLayout.h"
 #include "nsIServiceManager.h"
 #include "nsGUIEvent.h"
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsDisplayList.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/LookAndFeel.h"
 
 using namespace mozilla;
 
 PRBool nsSliderFrame::gMiddlePref = PR_FALSE;
 PRInt32 nsSliderFrame::gSnapMultiplier;
 
 // Turn this on if you want to debug slider frames.
 #undef DEBUG_SLIDER
@@ -604,26 +604,21 @@ nsSliderFrame::GetScrollToClick()
   // Otherwise, the default is true on Mac and false on other platforms.
   if (GetScrollbar() == this)
 #ifdef XP_MACOSX
     return !mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::movetoclick,
                                    nsGkAtoms::_false, eCaseMatters);
  
   // if there was no scrollbar, always scroll on click
   PRBool scrollToClick = PR_FALSE;
-  nsresult rv;
-  nsCOMPtr<nsILookAndFeel> lookNFeel =
-    do_GetService("@mozilla.org/widget/lookandfeel;1", &rv);
-  if (NS_SUCCEEDED(rv)) {
-    PRInt32 scrollToClickMetric;
-    rv = lookNFeel->GetMetric(nsILookAndFeel::eMetric_ScrollToClick,
-                              scrollToClickMetric);
-    if (NS_SUCCEEDED(rv) && scrollToClickMetric == 1)
-      scrollToClick = PR_TRUE;
-  }
+  PRInt32 scrollToClickMetric;
+  nsresult rv = LookAndFeel::GetInt(LookAndFeel::eIntID_ScrollToClick,
+                                    &scrollToClickMetric);
+  if (NS_SUCCEEDED(rv) && scrollToClickMetric == 1)
+    scrollToClick = PR_TRUE;
   return scrollToClick;
 
 #else
     return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::movetoclick,
                                   nsGkAtoms::_true, eCaseMatters);
   return PR_FALSE;
 #endif
 }
--- a/layout/xul/base/src/nsSplitterFrame.cpp
+++ b/layout/xul/base/src/nsSplitterFrame.cpp
@@ -54,17 +54,16 @@
 #include "nsINameSpaceManager.h"
 #include "nsScrollbarButtonFrame.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIPresShell.h"
 #include "nsFrameList.h"
 #include "nsHTMLParts.h"
-#include "nsILookAndFeel.h"
 #include "nsStyleContext.h"
 #include "nsBoxLayoutState.h"
 #include "nsIXBLService.h"
 #include "nsIServiceManager.h"
 #include "nsHTMLContainerFrame.h"
 #include "nsGUIEvent.h"
 #include "nsAutoPtr.h"
 #include "nsContentCID.h"
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -48,17 +48,16 @@
 #include "nsIXULDocument.h"
 #include "nsIXULTemplateBuilder.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsEventStateManager.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsLayoutUtils.h"
 #include "nsIViewManager.h"
-#include "nsILookAndFeel.h"
 #include "nsIComponentManager.h"
 #include "nsITimer.h"
 #include "nsFocusManager.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIBaseWindow.h"
@@ -66,16 +65,19 @@
 #include "nsIDOMMouseEvent.h"
 #include "nsCaret.h"
 #include "nsIDocument.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsFrameManager.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
+#include "mozilla/LookAndFeel.h"
+
+using namespace mozilla;
 
 #define FLAG_ALT        0x01
 #define FLAG_CONTROL    0x02
 #define FLAG_SHIFT      0x04
 #define FLAG_META       0x08
 
 const nsNavigationDirection DirectionFromKeyCodeTable[2][6] = {
   {
@@ -1011,19 +1013,18 @@ nsXULPopupManager::HidePopup(nsIView* aV
 
 void
 nsXULPopupManager::HidePopupAfterDelay(nsMenuPopupFrame* aPopup)
 {
   // Don't close up immediately.
   // Kick off a close timer.
   KillMenuTimer();
 
-  PRInt32 menuDelay = 300;   // ms
-  aPopup->PresContext()->LookAndFeel()->
-    GetMetric(nsILookAndFeel::eMetric_SubmenuDelay, menuDelay);
+  PRInt32 menuDelay =
+    LookAndFeel::GetInt(LookAndFeel::eIntID_SubmenuDelay, 300); // ms
 
   // Kick off the timer.
   mCloseTimer = do_CreateInstance("@mozilla.org/timer;1");
   mCloseTimer->InitWithCallback(this, menuDelay, nsITimer::TYPE_ONE_SHOT);
 
   // the popup will call PopupDestroyed if it is destroyed, which checks if it
   // is set to mTimerMenu, so it should be safe to keep a reference to it
   mTimerMenu = aPopup;
@@ -2087,21 +2088,21 @@ nsXULPopupManager::IsValidMenuItem(nsPre
   if (ns == kNameSpaceID_XUL) {
     if (tag != nsGkAtoms::menu && tag != nsGkAtoms::menuitem)
       return PR_FALSE;
   }
   else if (ns != kNameSpaceID_XHTML || !aOnPopup || tag != nsGkAtoms::option) {
     return PR_FALSE;
   }
 
-  PRInt32 skipNavigatingDisabledMenuItem = PR_TRUE;
+  PRBool skipNavigatingDisabledMenuItem = PR_TRUE;
   if (aOnPopup) {
-    aPresContext->LookAndFeel()->
-      GetMetric(nsILookAndFeel::eMetric_SkipNavigatingDisabledMenuItem,
-                skipNavigatingDisabledMenuItem);
+    skipNavigatingDisabledMenuItem =
+      LookAndFeel::GetInt(LookAndFeel::eIntID_SkipNavigatingDisabledMenuItem,
+                          0) != 0;
   }
 
   return !(skipNavigatingDisabledMenuItem &&
            aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
                                  nsGkAtoms::_true, eCaseMatters));
 }
 
 nsresult
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -102,16 +102,18 @@
 #include "nsDisplayList.h"
 #include "nsTreeBoxObject.h"
 #include "nsRenderingContext.h"
 
 #ifdef IBMBIDI
 #include "nsBidiUtils.h"
 #endif
 
+using namespace mozilla;
+
 // Enumeration function that cancels all the image requests in our cache
 static PLDHashOperator
 CancelImageRequest(const nsAString& aKey,
                    nsTreeImageCacheEntry aEntry, void* aData)
 {
   aEntry.request->CancelAndForgetObserver(NS_BINDING_ABORTED);
   return PL_DHASH_NEXT;
 }
@@ -1788,23 +1790,22 @@ nsTreeBodyFrame::MarkDirtyIfSelect()
     mStringWidth = -1;
     PresContext()->PresShell()->FrameNeedsReflow(this,
                                                  nsIPresShell::eTreeChange,
                                                  NS_FRAME_IS_DIRTY);
   }
 }
 
 nsresult
-nsTreeBodyFrame::CreateTimer(const nsILookAndFeel::nsMetricID aID,
+nsTreeBodyFrame::CreateTimer(const LookAndFeel::IntID aID,
                              nsTimerCallbackFunc aFunc, PRInt32 aType,
                              nsITimer** aTimer)
 {
   // Get the delay from the look and feel service.
-  PRInt32 delay = 0;
-  PresContext()->LookAndFeel()->GetMetric(aID, delay);
+  PRInt32 delay = LookAndFeel::GetInt(aID, 0);
 
   nsCOMPtr<nsITimer> timer;
 
   // Create a new timer only if the delay is greater than zero.
   // Zero value means that this feature is completely disabled.
   if (delay > 0) {
     timer = do_CreateInstance("@mozilla.org/timer;1");
     if (timer)
@@ -2628,17 +2629,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
       if (!lastScrollLines) {
         // Cancel any previously initialized timer.
         if (mSlots->mTimer) {
           mSlots->mTimer->Cancel();
           mSlots->mTimer = nsnull;
         }
 
         // Set a timer to trigger the tree scrolling.
-        CreateTimer(nsILookAndFeel::eMetric_TreeLazyScrollDelay,
+        CreateTimer(LookAndFeel::eIntID_TreeLazyScrollDelay,
                     LazyScrollCallback, nsITimer::TYPE_ONE_SHOT,
                     getter_AddRefs(mSlots->mTimer));
        }
 #endif
       // Bail out to prevent spring loaded timer and feedback line settings.
       return NS_OK;
     }
 
@@ -2666,17 +2667,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
           // If over a folder, start up a timer to open the folder.
           PRBool isContainer = PR_FALSE;
           mView->IsContainer(mSlots->mDropRow, &isContainer);
           if (isContainer) {
             PRBool isOpen = PR_FALSE;
             mView->IsContainerOpen(mSlots->mDropRow, &isOpen);
             if (!isOpen) {
               // This node isn't expanded, set a timer to expand it.
-              CreateTimer(nsILookAndFeel::eMetric_TreeOpenDelay,
+              CreateTimer(LookAndFeel::eIntID_TreeOpenDelay,
                           OpenCallback, nsITimer::TYPE_ONE_SHOT,
                           getter_AddRefs(mSlots->mTimer));
             }
           }
         }
 
         NS_ASSERTION(aEvent->eventStructType == NS_DRAG_EVENT, "wrong event type");
         nsDragEvent* dragEvent = static_cast<nsDragEvent*>(aEvent);
@@ -2743,17 +2744,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
     // by the drop event.
     if (mSlots->mTimer) {
       mSlots->mTimer->Cancel();
       mSlots->mTimer = nsnull;
     }
 
     if (!mSlots->mArray.IsEmpty()) {
       // Close all spring loaded folders except the drop folder.
-      CreateTimer(nsILookAndFeel::eMetric_TreeCloseDelay,
+      CreateTimer(LookAndFeel::eIntID_TreeCloseDelay,
                   CloseCallback, nsITimer::TYPE_ONE_SHOT,
                   getter_AddRefs(mSlots->mTimer));
     }
   }
 
   return NS_OK;
 }
 
@@ -4342,19 +4343,18 @@ nsTreeBodyFrame::ComputeDropPosition(nsG
         *aOrient = nsITreeView::DROP_BEFORE;
       else
         *aOrient = nsITreeView::DROP_AFTER;
     }
   }
 
   if (CanAutoScroll(*aRow)) {
     // Get the max value from the look and feel service.
-    PRInt32 scrollLinesMax = 0;
-    PresContext()->LookAndFeel()->
-      GetMetric(nsILookAndFeel::eMetric_TreeScrollLinesMax, scrollLinesMax);
+    PRInt32 scrollLinesMax =
+      LookAndFeel::GetInt(LookAndFeel::eIntID_TreeScrollLinesMax, 0);
     scrollLinesMax--;
     if (scrollLinesMax < 0)
       scrollLinesMax = 0;
 
     // Determine if we're w/in a margin of the top/bottom of the tree during a drag.
     // This will ultimately cause us to scroll, but that's done elsewhere.
     nscoord height = (3 * mRowHeight) / 4;
     if (yTwips < height) {
@@ -4404,17 +4404,17 @@ nsTreeBodyFrame::LazyScrollCallback(nsIT
 {
   nsTreeBodyFrame* self = static_cast<nsTreeBodyFrame*>(aClosure);
   if (self) {
     aTimer->Cancel();
     self->mSlots->mTimer = nsnull;
 
     if (self->mView) {
       // Set a new timer to scroll the tree repeatedly.
-      self->CreateTimer(nsILookAndFeel::eMetric_TreeScrollDelay,
+      self->CreateTimer(LookAndFeel::eIntID_TreeScrollDelay,
                         ScrollCallback, nsITimer::TYPE_REPEATING_SLACK,
                         getter_AddRefs(self->mSlots->mTimer));
       self->ScrollByLines(self->mSlots->mScrollLines);
       // ScrollByLines may have deleted |self|.
     }
   }
 }
 
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
@@ -46,27 +46,27 @@
 
 #include "nsLeafBoxFrame.h"
 #include "nsITreeView.h"
 #include "nsICSSPseudoComparator.h"
 #include "nsIScrollbarMediator.h"
 #include "nsIDragSession.h"
 #include "nsITimer.h"
 #include "nsIReflowCallback.h"
-#include "nsILookAndFeel.h"
 #include "nsTArray.h"
 #include "nsTreeStyleCache.h"
 #include "nsTreeColumns.h"
 #include "nsTreeImageListener.h"
 #include "nsAutoPtr.h"
 #include "nsDataHashtable.h"
 #include "imgIRequest.h"
 #include "imgIDecoderObserver.h"
 #include "nsScrollbarFrame.h"
 #include "nsThreadUtils.h"
+#include "mozilla/LookAndFeel.h"
 
 class nsOverflowChecker;
 
 // An entry in the tree's image cache
 struct nsTreeImageCacheEntry
 {
   nsTreeImageCacheEntry() {}
   nsTreeImageCacheEntry(imgIRequest *aRequest, imgIDecoderObserver *aListener)
@@ -436,17 +436,17 @@ public:
   }
 
 protected:
 
   // Create a new timer. This method is used to delay various actions like
   // opening/closing folders or tree scrolling.
   // aID is type of the action, aFunc is the function to be called when
   // the timer fires and aType is type of timer - one shot or repeating.
-  nsresult CreateTimer(const nsILookAndFeel::nsMetricID aID,
+  nsresult CreateTimer(const mozilla::LookAndFeel::IntID aID,
                        nsTimerCallbackFunc aFunc, PRInt32 aType,
                        nsITimer** aTimer);
 
   static void OpenCallback(nsITimer *aTimer, void *aClosure);
 
   static void CloseCallback(nsITimer *aTimer, void *aClosure);
 
   static void LazyScrollCallback(nsITimer *aTimer, void *aClosure);