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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2550463002: [Mac] Opt browser window controller out of being a touch bar provider (Closed)
Patch Set: Formatting and added radar number Created 4 years 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: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 91b0f3a31c4698ed6d48339944e03e9107c2c086..cffc7903dba949c70785bf87e4f1da21218f1e2f 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -431,6 +431,26 @@ bool IsTabDetachingInFullscreenEnabled() {
[super dealloc];
}
+// Hack to address crbug.com/667274
+// On TouchBar MacBooks, the touch bar machinery retains a reference
+// to the browser window controller (which is an NSTouchBarProvider by
+// default) but doesn't release it if Chrome quits before it takes the
+// key window (for example, quitting from the Dock icon context menu.)
+//
+// If the window denies being a touch bar provider, it's never added
+// to the set of providers and the reference is never taken. This
+// prevents us from providing a touch bar from the window directly
+// but descendant responders can still provide one.
+//
+// rdar://29467717
+- (BOOL)conformsToProtocol:(Protocol*)protocol {
+ if ([protocol isEqual:NSProtocolFromString(@"NSFunctionBarProvider")] ||
+ [protocol isEqual:NSProtocolFromString(@"NSTouchBarProvider")]) {
+ return NO;
+ }
+ return [super conformsToProtocol:protocol];
+}
+
- (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds {
gfx::Rect checkedBounds = bounds;
« 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