Always set NSScrollViewRubberbanding scroll bounce pref

This commit is contained in:
Kevin Sawicki 2017-04-06 15:42:37 -07:00
parent e2a00e423c
commit 29c68182df

View file

@ -96,16 +96,14 @@ void RendererClientBase::RenderThreadStarted() {
#endif
#if defined(OS_MACOSX)
// Disable rubber banding by default.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kScrollBounce)) {
base::ScopedCFTypeRef<CFStringRef> key(
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
base::ScopedCFTypeRef<CFStringRef> value(
base::SysUTF8ToCFStringRef("false"));
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
bool scroll_bounce = command_line->HasSwitch(switches::kScrollBounce);
base::ScopedCFTypeRef<CFStringRef> rubber_banding_key(
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
CFPreferencesSetAppValue(rubber_banding_key,
scroll_bounce ? kCFBooleanTrue : kCFBooleanFalse,
kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
#endif
}