Chromium Code Reviews| 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..cfca6a48ce31acca77252cb6d095580099110073 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. |
| +// |
| +// TODO(lgrey): Add radar here once it's been filed. |
| +- (BOOL)conformsToProtocol:(Protocol* )protocol { |
|
Robert Sesek
2016/12/01 21:23:05
nit: extra space after *
|
| + 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; |