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 #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Disable rubber banding by default.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kScrollBounce)) { bool scroll_bounce = command_line->HasSwitch(switches::kScrollBounce);
base::ScopedCFTypeRef<CFStringRef> key( base::ScopedCFTypeRef<CFStringRef> rubber_banding_key(
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
base::ScopedCFTypeRef<CFStringRef> value( CFPreferencesSetAppValue(rubber_banding_key,
base::SysUTF8ToCFStringRef("false")); scroll_bounce ? kCFBooleanTrue : kCFBooleanFalse,
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication); kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
#endif #endif
} }