Chromium Code Reviews| Index: chrome/browser/chrome_browser_application_mac.mm |
| diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm |
| index a332cb17c4053ccfd86da5a91d7b6229b7f0ee67..0143022ba75d7190b264d5c862f6e052df9f519e 100644 |
| --- a/chrome/browser/chrome_browser_application_mac.mm |
| +++ b/chrome/browser/chrome_browser_application_mac.mm |
| @@ -266,6 +266,31 @@ void CancelTerminate() { |
| [appController stopTryingToTerminateApplication:self]; |
| } |
| +// The event |mask| has historically been declared as an NSUInteger |
| +// (unsigned long). Starting in the 10.12 SDK, the mask type changed to |
| +// NSEventMask (unsigned long long) if __LP64__ and NSUInteger otherwise. |
| +// These types are incompatible, which creates an issue for suppporting |
| +// both 10.10/10.11 and 10.12 SDKs. Work around it using the #if below. |
| +- (NSEvent*)nextEventMatchingMask: |
| +#if !defined(MAC_OS_X_VERSION_10_12) || \ |
|
Mark Mentovai
2016/10/19 23:01:39
#include <AvailabilityMacros.h>
Robert Sesek
2016/10/19 23:22:12
Done.
|
| + MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 |
|
Mark Mentovai
2016/10/19 23:01:39
Match what the SDK does by working __LP64__ into t
Robert Sesek
2016/10/19 23:22:12
That would be exciting. Done.
|
| + (NSUInteger)mask |
| +#else |
| + (NSEventMask)mask |
| +#endif |
| + untilDate:(NSDate*)expiration |
| + inMode:(NSString*)mode |
| + dequeue:(BOOL)dequeue { |
| + __block NSEvent* event = nil; |
| + base::mac::CallWithEHFrame(^{ |
| + event = [super nextEventMatchingMask:mask |
| + untilDate:expiration |
| + inMode:mode |
| + dequeue:dequeue]; |
| + }); |
| + return event; |
| +} |
| + |
| - (BOOL)sendAction:(SEL)anAction to:(id)aTarget from:(id)sender { |
| // The Dock menu contains an automagic section where you can select |
| // amongst open windows. If a window is closed via JavaScript while |