| 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;
|
|
|
|
|