| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 [tabStripController_ browserWillBeDestroyed]; | 439 [tabStripController_ browserWillBeDestroyed]; |
| 440 [findBarCocoaController_ browserWillBeDestroyed]; | 440 [findBarCocoaController_ browserWillBeDestroyed]; |
| 441 [downloadShelfController_ browserWillBeDestroyed]; | 441 [downloadShelfController_ browserWillBeDestroyed]; |
| 442 [bookmarkBarController_ browserWillBeDestroyed]; | 442 [bookmarkBarController_ browserWillBeDestroyed]; |
| 443 [avatarButtonController_ browserWillBeDestroyed]; | 443 [avatarButtonController_ browserWillBeDestroyed]; |
| 444 [bookmarkBubbleController_ browserWillBeDestroyed]; | 444 [bookmarkBubbleController_ browserWillBeDestroyed]; |
| 445 | 445 |
| 446 [super dealloc]; | 446 [super dealloc]; |
| 447 } | 447 } |
| 448 | 448 |
| 449 // Hack to address crbug.com/667274 |
| 450 // On TouchBar MacBooks, the touch bar machinery retains a reference |
| 451 // to the browser window controller (which is an NSTouchBarProvider by |
| 452 // default) but doesn't release it if Chrome quits before it takes the |
| 453 // key window (for example, quitting from the Dock icon context menu.) |
| 454 // |
| 455 // If the window denies being a touch bar provider, it's never added |
| 456 // to the set of providers and the reference is never taken. This |
| 457 // prevents us from providing a touch bar from the window directly |
| 458 // but descendant responders can still provide one. |
| 459 // |
| 460 // rdar://29467717 |
| 461 - (BOOL)conformsToProtocol:(Protocol*)protocol { |
| 462 if ([protocol isEqual:NSProtocolFromString(@"NSFunctionBarProvider")] || |
| 463 [protocol isEqual:NSProtocolFromString(@"NSTouchBarProvider")]) { |
| 464 return NO; |
| 465 } |
| 466 return [super conformsToProtocol:protocol]; |
| 467 } |
| 468 |
| 449 - (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds { | 469 - (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds { |
| 450 gfx::Rect checkedBounds = bounds; | 470 gfx::Rect checkedBounds = bounds; |
| 451 | 471 |
| 452 NSSize minSize = [[self window] minSize]; | 472 NSSize minSize = [[self window] minSize]; |
| 453 if (bounds.width() < minSize.width) | 473 if (bounds.width() < minSize.width) |
| 454 checkedBounds.set_width(minSize.width); | 474 checkedBounds.set_width(minSize.width); |
| 455 if (bounds.height() < minSize.height) | 475 if (bounds.height() < minSize.height) |
| 456 checkedBounds.set_height(minSize.height); | 476 checkedBounds.set_height(minSize.height); |
| 457 | 477 |
| 458 return checkedBounds; | 478 return checkedBounds; |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 | 2069 |
| 2050 - (NSRect)savedRegularWindowFrame { | 2070 - (NSRect)savedRegularWindowFrame { |
| 2051 return savedRegularWindowFrame_; | 2071 return savedRegularWindowFrame_; |
| 2052 } | 2072 } |
| 2053 | 2073 |
| 2054 - (BOOL)isFullscreenTransitionInProgress { | 2074 - (BOOL)isFullscreenTransitionInProgress { |
| 2055 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2075 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
| 2056 } | 2076 } |
| 2057 | 2077 |
| 2058 @end // @implementation BrowserWindowController(WindowType) | 2078 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |