From 6a7353be3ee46327eac391f8ef2531ca5369811c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 23 Jul 2013 17:21:09 +0000 Subject: [PATCH] Mac: Fix compile error in cefclient_osr_widget_mac.mm when using the 10.6 SDK. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1335 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tests/cefclient/cefclient_osr_widget_mac.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/cefclient/cefclient_osr_widget_mac.mm b/tests/cefclient/cefclient_osr_widget_mac.mm index fd9ec6960..6f41caeb8 100644 --- a/tests/cefclient/cefclient_osr_widget_mac.mm +++ b/tests/cefclient/cefclient_osr_widget_mac.mm @@ -468,7 +468,10 @@ void ClientOSRHandler::SetLoading(bool isLoading) { [self keyDown:event]; } -- (void) shortCircuitScrollWheelEvent:(NSEvent*)event { +- (void)shortCircuitScrollWheelEvent:(NSEvent*)event { +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ + __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + // Phase is only supported in OS-X 10.7 and newer. if ([event phase] != NSEventPhaseEnded && [event phase] != NSEventPhaseCancelled) return; @@ -479,9 +482,13 @@ void ClientOSRHandler::SetLoading(bool isLoading) { [NSEvent removeMonitor:endWheelMonitor_]; endWheelMonitor_ = nil; } +#endif } - (void)scrollWheel:(NSEvent *)event { +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ + __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + // Phase is only supported in OS-X 10.7 and newer. // Use an NSEvent monitor to listen for the wheel-end end. This ensures that // the event is received even when the mouse cursor is no longer over the // view when the scrolling ends. Also it avoids sending duplicate scroll @@ -497,6 +504,7 @@ void ClientOSRHandler::SetLoading(bool isLoading) { } [self sendScrollWheelEvet:event]; +#endif } - (void)sendScrollWheelEvet:(NSEvent *)event {