2011-01-07 Mihai Parparita <mihaip@chromium.org>
authormihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2011 00:38:42 +0000 (00:38 +0000)
committermihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2011 00:38:42 +0000 (00:38 +0000)
        Reviewed by Darin Fisher.

        [Chromium] Scrollbar code cleanup
        https://bugs.webkit.org/show_bug.cgi?id=52073

        Scrollbar code cleanup:
        - Remove ScrollbarThemeMac.{mm|h} from the mac sources list, we use
          ScrollbarThemeChromiumMac.{mm|h}
        - Remove USE_WEB_THEME_ENGINE_TO_PAINT_THUMB #define now that switch to
          WebThemeEngine is permanent
        - Fix typo in Linux scrollbar enum name

        No new tests (compiles).

        * WebCore.gypi:
        * platform/chromium/ChromiumBridge.h:
        * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
        (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
        * platform/chromium/ScrollbarThemeChromiumMac.mm:
        (WebCore::scrollbarStateToThemeState):
        (WebCore::ScrollbarThemeChromiumMac::paint):
2011-01-07  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] Scrollbar code cleanup
        https://bugs.webkit.org/show_bug.cgi?id=52073

        Scrollbar code cleanup:
        - Fix typo in Linux scrollbar enum name

        * public/linux/WebThemeEngine.h:
        * src/ChromiumBridge.cpp:
        (WebCore::WebThemePart):
        (WebCore::GetWebThemeExtraParams):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.gypi
WebCore/platform/chromium/ChromiumBridge.h
WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
WebKit/chromium/ChangeLog
WebKit/chromium/public/linux/WebThemeEngine.h
WebKit/chromium/src/ChromiumBridge.cpp

index dec33af..3daff76 100644 (file)
@@ -1,3 +1,27 @@
+2011-01-07  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Scrollbar code cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=52073
+
+        Scrollbar code cleanup:
+        - Remove ScrollbarThemeMac.{mm|h} from the mac sources list, we use
+          ScrollbarThemeChromiumMac.{mm|h}
+        - Remove USE_WEB_THEME_ENGINE_TO_PAINT_THUMB #define now that switch to
+          WebThemeEngine is permanent
+        - Fix typo in Linux scrollbar enum name
+
+        No new tests (compiles).
+
+        * WebCore.gypi:
+        * platform/chromium/ChromiumBridge.h:
+        * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
+        (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
+        * platform/chromium/ScrollbarThemeChromiumMac.mm:
+        (WebCore::scrollbarStateToThemeState):
+        (WebCore::ScrollbarThemeChromiumMac::paint):
+
 2011-01-07  Jer Noble  <jer.noble@apple.com>
 
         GTK Linux build fix: isDocumentRunningFullScreenAnimation should
index d5df56c..9a0421d 100644 (file)
             'platform/mac/SSLKeyGeneratorMac.mm',
             'platform/mac/SchedulePairMac.mm',
             'platform/mac/ScrollViewMac.mm',
-            'platform/mac/ScrollbarThemeMac.h',
-            'platform/mac/ScrollbarThemeMac.mm',
             'platform/mac/SearchPopupMenuMac.h',
             'platform/mac/SearchPopupMenuMac.mm',
             'platform/mac/SharedBufferMac.mm',
index ebe48bd..56969ef 100644 (file)
@@ -277,7 +277,7 @@ namespace WebCore {
             PartScrollbarUpArrow,
             PartScrollbarHorizontalThumb,
             PartScrollbarVerticalThumb,
-            PartScrollbarHoriztonalTrack,
+            PartScrollbarHorizontalTrack,
             PartScrollbarVerticalTrack,
         };
 
index 46e6993..ba10953 100644 (file)
@@ -61,7 +61,7 @@ void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar
     extraParams.scrollbarTrack.trackHeight = alignRect.height();
     ChromiumBridge::paintThemePart(
         gc,
-        scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::PartScrollbarHoriztonalTrack : ChromiumBridge::PartScrollbarVerticalTrack,
+        scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::PartScrollbarHorizontalTrack : ChromiumBridge::PartScrollbarVerticalTrack,
         state,
         rect,
         &extraParams);
index d13d41e..0aa3e10 100644 (file)
 #include "config.h"
 #include "ScrollbarThemeChromiumMac.h"
 
-// FIXME: Remove this (always use WebThemeEngine) once we rebaseline tests
-#define USE_WEB_THEME_ENGINE_TO_PAINT_THUMB 1
-
-#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
 #include "ChromiumBridge.h"
 #include "FrameView.h"
-#endif
 #include "ImageBuffer.h"
 #include "PlatformMouseEvent.h"
 #include "ScrollView.h"
@@ -54,6 +49,7 @@ using namespace WebCore;
 // The only changes from ScrollbarThemeMac should be:
 // - The classname change from ScrollbarThemeMac to ScrollbarThemeChromiumMac.
 // - In paint() the code to paint the track, tickmarks, and thumb separately.
+// - In paint() the thumb is drawn via ChromeBridge/WebThemeEngine.
 //
 // For all other differences, if it was introduced in this file, then the
 // maintainer forgot to include it in the list; otherwise it is an update that
@@ -374,7 +370,6 @@ static int scrollbarPartToHIPressedState(ScrollbarPart part)
     }
 }
 
-#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
 static ChromiumBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar) {
     if (!scrollbar->enabled())
         return ChromiumBridge::StateDisabled;
@@ -385,7 +380,6 @@ static ChromiumBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scr
 
     return ChromiumBridge::StateActive;
 }
-#endif // USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
 
 bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
@@ -469,7 +463,6 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     }
 
     if (hasThumb(scrollbar)) {
-#if USE_WEB_THEME_ENGINE_TO_PAINT_THUMB
         ChromiumBridge::ThemePaintScrollbarInfo scrollbarInfo;
         scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? ChromiumBridge::ScrollbarOrientationHorizontal : ChromiumBridge::ScrollbarOrientationVertical;
         scrollbarInfo.parent = scrollbar->parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? ChromiumBridge::ScrollbarParentScrollView : ChromiumBridge::ScrollbarParentRenderLayer;
@@ -484,10 +477,6 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
             scrollbar->controlSize() == RegularScrollbar ? ChromiumBridge::SizeRegular : ChromiumBridge::SizeSmall,
             scrollbar->frameRect(),
             scrollbarInfo);
-#else
-        trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
-        HIThemeDrawTrack(&trackInfo, 0, drawingContext->platformContext(), kHIThemeOrientationNormal);
-#endif
     }
 
     if (!canDrawDirectly)
index 0092003..15d5f0f 100644 (file)
@@ -1,3 +1,18 @@
+2011-01-07  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Scrollbar code cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=52073
+
+        Scrollbar code cleanup:
+        - Fix typo in Linux scrollbar enum name
+
+        * public/linux/WebThemeEngine.h:
+        * src/ChromiumBridge.cpp:
+        (WebCore::WebThemePart):
+        (WebCore::GetWebThemeExtraParams):
+
 2011-01-07  James Robinson  <jamesr@chromium.org>
 
         Revert "Implement mozilla's animationTime property"
index fd72cf7..6f8cdc7 100644 (file)
@@ -39,6 +39,9 @@ namespace WebKit {
 
 struct WebRect;
 
+// FIXME: Remove once webkit/glue/webthemeengine_impl_linux.c has been updated to use the correct spelling.
+#define PartScrollbarHoriztonalTrack PartScrollbarHorizontalTrack
+
 class WebThemeEngine {
 public:
     // The UI part which is being accessed.
@@ -49,7 +52,7 @@ public:
         PartScrollbarUpArrow,
         PartScrollbarHorizontalThumb,
         PartScrollbarVerticalThumb,
-        PartScrollbarHoriztonalTrack,
+        PartScrollbarHorizontalTrack,
         PartScrollbarVerticalTrack
     };
 
@@ -61,7 +64,7 @@ public:
         StatePressed,
     };
 
-    // Extra parameters for drawing the PartScrollbarHoriztonalTrack and
+    // Extra parameters for drawing the PartScrollbarHorizontalTrack and
     // PartScrollbarVerticalTrack.
     struct ScrollbarTrackExtraParams {
         // The bounds of the entire track, as opposed to the part being painted.
index 4e2714f..38a3f1d 100644 (file)
@@ -803,7 +803,7 @@ static WebThemeEngine::Part WebThemePart(ChromiumBridge::ThemePart part)
     case ChromiumBridge::PartScrollbarUpArrow: return WebThemeEngine::PartScrollbarUpArrow;
     case ChromiumBridge::PartScrollbarHorizontalThumb: return WebThemeEngine::PartScrollbarHorizontalThumb;
     case ChromiumBridge::PartScrollbarVerticalThumb: return WebThemeEngine::PartScrollbarVerticalThumb;
-    case ChromiumBridge::PartScrollbarHoriztonalTrack: return WebThemeEngine::PartScrollbarHoriztonalTrack;
+    case ChromiumBridge::PartScrollbarHorizontalTrack: return WebThemeEngine::PartScrollbarHorizontalTrack;
     case ChromiumBridge::PartScrollbarVerticalTrack: return WebThemeEngine::PartScrollbarVerticalTrack;
     }
     ASSERT_NOT_REACHED();
@@ -824,7 +824,7 @@ static WebThemeEngine::State WebThemeState(ChromiumBridge::ThemePaintState state
 
 static void GetWebThemeExtraParams(ChromiumBridge::ThemePart part, ChromiumBridge::ThemePaintState state, const ChromiumBridge::ThemePaintExtraParams* extraParams, WebThemeEngine::ExtraParams* webThemeExtraParams)
 {
-    if (part == ChromiumBridge::PartScrollbarHoriztonalTrack || part == ChromiumBridge::PartScrollbarVerticalTrack) {
+    if (part == ChromiumBridge::PartScrollbarHorizontalTrack || part == ChromiumBridge::PartScrollbarVerticalTrack) {
         webThemeExtraParams->scrollbarTrack.trackX = extraParams->scrollbarTrack.trackX;
         webThemeExtraParams->scrollbarTrack.trackY = extraParams->scrollbarTrack.trackY;
         webThemeExtraParams->scrollbarTrack.trackWidth = extraParams->scrollbarTrack.trackWidth;