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
This commit is contained in:
Marshall Greenblatt 2013-07-23 17:21:09 +00:00
parent 4abdd35309
commit 6a7353be3e
1 changed files with 9 additions and 1 deletions

View File

@ -468,7 +468,10 @@ void ClientOSRHandler::SetLoading(bool isLoading) {
[self keyDown:event]; [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 && if ([event phase] != NSEventPhaseEnded &&
[event phase] != NSEventPhaseCancelled) [event phase] != NSEventPhaseCancelled)
return; return;
@ -479,9 +482,13 @@ void ClientOSRHandler::SetLoading(bool isLoading) {
[NSEvent removeMonitor:endWheelMonitor_]; [NSEvent removeMonitor:endWheelMonitor_];
endWheelMonitor_ = nil; endWheelMonitor_ = nil;
} }
#endif
} }
- (void)scrollWheel:(NSEvent *)event { - (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 // 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 // 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 // view when the scrolling ends. Also it avoids sending duplicate scroll
@ -497,6 +504,7 @@ void ClientOSRHandler::SetLoading(bool isLoading) {
} }
[self sendScrollWheelEvet:event]; [self sendScrollWheelEvet:event];
#endif
} }
- (void)sendScrollWheelEvet:(NSEvent *)event { - (void)sendScrollWheelEvet:(NSEvent *)event {