| Index: base/message_loop/message_pump_mac.mm
|
| diff --git a/base/message_loop/message_pump_mac.mm b/base/message_loop/message_pump_mac.mm
|
| index b50ea6878813ba1f047cfc291e731c53f3d9fe90..dd1cc88ba9df9d60f965c748321008f85a6083bb 100644
|
| --- a/base/message_loop/message_pump_mac.mm
|
| +++ b/base/message_loop/message_pump_mac.mm
|
| @@ -26,38 +26,53 @@ namespace base {
|
|
|
| namespace {
|
|
|
| +const CFStringRef kAllModes[] = {
|
| + kCFRunLoopCommonModes,
|
| + kMessageLoopExclusiveRunLoopMode,
|
| +
|
| + // Process work when NSMenus are fading out.
|
| + CFSTR("com.apple.hitoolbox.windows.windowfadingmode"),
|
| +
|
| + // Process work when AppKit is highlighting an item on the main menubar.
|
| + CFSTR("NSUnhighlightMenuRunLoopMode"),
|
| +
|
| + // Other modes that aren't strictly necessary:
|
| + //CFSTR("com.apple.hitoolbox.windows.transitionmode"),
|
| + //CFSTR("com.apple.hitoolbox.windows.flushmode"),
|
| +};
|
| +
|
| void CFRunLoopAddSourceToAllModes(CFRunLoopRef rl, CFRunLoopSourceRef source) {
|
| - CFRunLoopAddSource(rl, source, kCFRunLoopCommonModes);
|
| - CFRunLoopAddSource(rl, source, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopAddSource(rl, source, mode);
|
| }
|
|
|
| void CFRunLoopRemoveSourceFromAllModes(CFRunLoopRef rl,
|
| CFRunLoopSourceRef source) {
|
| - CFRunLoopRemoveSource(rl, source, kCFRunLoopCommonModes);
|
| - CFRunLoopRemoveSource(rl, source, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopRemoveSource(rl, source, mode);
|
| }
|
|
|
| void CFRunLoopAddTimerToAllModes(CFRunLoopRef rl, CFRunLoopTimerRef timer) {
|
| - CFRunLoopAddTimer(rl, timer, kCFRunLoopCommonModes);
|
| - CFRunLoopAddTimer(rl, timer, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopAddTimer(rl, timer, mode);
|
| }
|
|
|
| void CFRunLoopRemoveTimerFromAllModes(CFRunLoopRef rl,
|
| CFRunLoopTimerRef timer) {
|
| - CFRunLoopRemoveTimer(rl, timer, kCFRunLoopCommonModes);
|
| - CFRunLoopRemoveTimer(rl, timer, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopRemoveTimer(rl, timer, mode);
|
| }
|
|
|
| void CFRunLoopAddObserverToAllModes(CFRunLoopRef rl,
|
| CFRunLoopObserverRef observer) {
|
| - CFRunLoopAddObserver(rl, observer, kCFRunLoopCommonModes);
|
| - CFRunLoopAddObserver(rl, observer, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopAddObserver(rl, observer, mode);
|
| }
|
|
|
| void CFRunLoopRemoveObserverFromAllModes(CFRunLoopRef rl,
|
| CFRunLoopObserverRef observer) {
|
| - CFRunLoopRemoveObserver(rl, observer, kCFRunLoopCommonModes);
|
| - CFRunLoopRemoveObserver(rl, observer, kMessageLoopExclusiveRunLoopMode);
|
| + for (const auto& mode : kAllModes)
|
| + CFRunLoopRemoveObserver(rl, observer, mode);
|
| }
|
|
|
| void NoOp(void* info) {
|
|
|