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

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

Issue 63213002: Have Blink be told of scrollbar changes rather than paying attention itself (Blink side part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « Source/core/platform/ScrollbarThemeMacCommon.h ('k') | Source/web/mac/WebScrollbarTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollbarThemeMacCommon.mm
diff --git a/Source/core/platform/ScrollbarThemeMacCommon.mm b/Source/core/platform/ScrollbarThemeMacCommon.mm
index 4417890ce0f48ccae0d77524f2db47eb4807f968..f37fb4475729d146058d0e21f4e2cc8f23f5c0d6 100644
--- a/Source/core/platform/ScrollbarThemeMacCommon.mm
+++ b/Source/core/platform/ScrollbarThemeMacCommon.mm
@@ -70,56 +70,6 @@ static ScrollbarSet& scrollbarSet()
}
-@interface WebScrollbarPrefsObserver : NSObject
-{
-}
-
-+ (void)registerAsObserver;
-+ (void)appearancePrefsChanged:(NSNotification*)theNotification;
-+ (void)behaviorPrefsChanged:(NSNotification*)theNotification;
-
-@end
-
-@implementation WebScrollbarPrefsObserver
-
-+ (void)appearancePrefsChanged:(NSNotification*)unusedNotification
-{
- UNUSED_PARAM(unusedNotification);
-
- ScrollbarTheme* theme = ScrollbarTheme::theme();
- if (theme->isMockTheme())
- return;
-
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- [defaults synchronize];
- static_cast<ScrollbarThemeMacCommon*>(ScrollbarTheme::theme())->preferencesChanged(
- [defaults floatForKey:@"NSScrollerButtonDelay"], [defaults floatForKey:@"NSScrollerButtonPeriod"],
- [defaults boolForKey:@"AppleScrollerPagingBehavior"], true);
-}
-
-+ (void)behaviorPrefsChanged:(NSNotification*)unusedNotification
-{
- UNUSED_PARAM(unusedNotification);
-
- ScrollbarTheme* theme = ScrollbarTheme::theme();
- if (theme->isMockTheme())
- return;
-
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- [defaults synchronize];
- static_cast<ScrollbarThemeMacCommon*>(ScrollbarTheme::theme())->preferencesChanged(
- [defaults floatForKey:@"NSScrollerButtonDelay"], [defaults floatForKey:@"NSScrollerButtonPeriod"],
- [defaults boolForKey:@"AppleScrollerPagingBehavior"], false);
-}
-
-+ (void)registerAsObserver
-{
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(appearancePrefsChanged:) name:@"AppleAquaScrollBarVariantChanged" object:nil suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(behaviorPrefsChanged:) name:@"AppleNoRedisplayAppearancePreferenceChanged" object:nil suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce];
-}
-
-@end
-
namespace WebCore {
static float gInitialButtonDelay = 0.5f;
@@ -138,7 +88,6 @@ ScrollbarTheme* ScrollbarTheme::nativeTheme()
DEFINE_STATIC_LOCAL(ScrollbarThemeMacNonOverlayAPI, nonOverlayTheme, ());
theme = &nonOverlayTheme;
}
- theme->Initialize();
return theme;
}
@@ -339,16 +288,6 @@ void ScrollbarThemeMacCommon::paintTickmarks(GraphicsContext* context, Scrollbar
paintGivenTickmarks(context, scrollbar, tickmarkTrackRect, tickmarks);
}
-void ScrollbarThemeMacCommon::Initialize()
-{
- [WebScrollbarPrefsObserver registerAsObserver];
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- [defaults synchronize];
- preferencesChanged(
- [defaults floatForKey:@"NSScrollerButtonDelay"], [defaults floatForKey:@"NSScrollerButtonPeriod"],
- [defaults boolForKey:@"AppleScrollerPagingBehavior"], false);
-}
-
ScrollbarThemeMacCommon::~ScrollbarThemeMacCommon()
{
}
« no previous file with comments | « Source/core/platform/ScrollbarThemeMacCommon.h ('k') | Source/web/mac/WebScrollbarTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698