Index: Source/platform/scroll/ScrollbarThemeMacCommon.mm |
diff --git a/Source/platform/scroll/ScrollbarThemeMacCommon.mm b/Source/platform/scroll/ScrollbarThemeMacCommon.mm |
index 402d99aa23091b5f68ae005b92ace64a5717dd2d..f111c063ad33d45ecdc08e1b22bc0983c4dfb929 100644 |
--- a/Source/platform/scroll/ScrollbarThemeMacCommon.mm |
+++ b/Source/platform/scroll/ScrollbarThemeMacCommon.mm |
@@ -24,7 +24,6 @@ |
*/ |
#include "config.h" |
-#include "RuntimeEnabledFeatures.h" |
#include "platform/scroll/ScrollbarThemeMacCommon.h" |
#include <Carbon/Carbon.h> |
@@ -75,14 +74,13 @@ |
static float gInitialButtonDelay = 0.5f; |
static float gAutoscrollButtonDelay = 0.05f; |
static bool gJumpOnTrackClick = false; |
-static NSScrollerStyle gPreferredScrollerStyle = NSScrollerStyleLegacy; |
ScrollbarTheme* ScrollbarTheme::nativeTheme() |
{ |
static ScrollbarThemeMacCommon* theme = NULL; |
if (theme) |
return theme; |
- if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { |
+ if (isScrollbarOverlayAPIAvailable()) { |
DEFINE_STATIC_LOCAL(ScrollbarThemeMacOverlayAPI, overlayTheme, ()); |
theme = &overlayTheme; |
} else { |
@@ -293,26 +291,18 @@ |
{ |
} |
-void ScrollbarThemeMacCommon::preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, NSScrollerStyle preferredScrollerStyle, bool redraw) |
+void ScrollbarThemeMacCommon::preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, bool redraw) |
{ |
updateButtonPlacement(); |
gInitialButtonDelay = initialButtonDelay; |
gAutoscrollButtonDelay = autoscrollButtonDelay; |
gJumpOnTrackClick = jumpOnTrackClick; |
- bool sendScrollerStyleNotification = gPreferredScrollerStyle != preferredScrollerStyle; |
- gPreferredScrollerStyle = preferredScrollerStyle; |
if (redraw && !scrollbarSet().isEmpty()) { |
ScrollbarSet::iterator end = scrollbarSet().end(); |
for (ScrollbarSet::iterator it = scrollbarSet().begin(); it != end; ++it) { |
(*it)->styleChanged(); |
(*it)->invalidate(); |
} |
- } |
- if (sendScrollerStyleNotification) { |
- [[NSNotificationCenter defaultCenter] |
- postNotificationName:@"NSPreferredScrollerStyleDidChangeNotification" |
- object:nil |
- userInfo:@{ @"NSScrollerStyle" : @(gPreferredScrollerStyle) }]; |
} |
} |
@@ -358,21 +348,4 @@ |
} |
} |
-// static |
-NSScrollerStyle ScrollbarThemeMacCommon::recommendedScrollerStyle() |
-{ |
- if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) |
- return NSScrollerStyleOverlay; |
- return gPreferredScrollerStyle; |
-} |
- |
-// static |
-bool ScrollbarThemeMacCommon::isOverlayAPIAvailable() |
-{ |
- static bool apiAvailable = |
- [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)] |
- && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)]; |
- return apiAvailable; |
-} |
- |
} // namespace WebCore |