Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2714)

Unified Diff: base/message_loop/message_pump_mac.mm

Issue 2118883002: [Mac] Add MessagePumpMac callouts to com.apple.hitoolbox.windows.windowfadingmode. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NSUnhighlightMenuRunLoopMode Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698