Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1865)

Unified Diff: Source/platform/scroll/ScrollbarThemeMacCommon.mm

Issue 147193002: Revert of Move preferred scrollbar style preference change listening from renderer to browser, 3 of 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeMacCommon.h ('k') | Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698