| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 [tabStripController_ browserWillBeDestroyed]; | 423 [tabStripController_ browserWillBeDestroyed]; |
| 424 [findBarCocoaController_ browserWillBeDestroyed]; | 424 [findBarCocoaController_ browserWillBeDestroyed]; |
| 425 [downloadShelfController_ browserWillBeDestroyed]; | 425 [downloadShelfController_ browserWillBeDestroyed]; |
| 426 [bookmarkBarController_ browserWillBeDestroyed]; | 426 [bookmarkBarController_ browserWillBeDestroyed]; |
| 427 [avatarButtonController_ browserWillBeDestroyed]; | 427 [avatarButtonController_ browserWillBeDestroyed]; |
| 428 [bookmarkBubbleController_ browserWillBeDestroyed]; | 428 [bookmarkBubbleController_ browserWillBeDestroyed]; |
| 429 | 429 |
| 430 [super dealloc]; | 430 [super dealloc]; |
| 431 } | 431 } |
| 432 | 432 |
| 433 // Hack to address crbug.com/667274 |
| 434 // On TouchBar MacBooks, the touch bar machinery retains a reference |
| 435 // to the browser window controller (which is an NSTouchBarProvider by |
| 436 // default) but doesn't release it if Chrome quits before it takes the |
| 437 // key window (for example, quitting from the Dock icon context menu.) |
| 438 // |
| 439 // If the window denies being a touch bar provider, it's never added |
| 440 // to the set of providers and the reference is never taken. This |
| 441 // prevents us from providing a touch bar from the window directly |
| 442 // but descendant responders can still provide one. |
| 443 // |
| 444 // rdar://29467717 |
| 445 - (BOOL)conformsToProtocol:(Protocol*)protocol { |
| 446 if ([protocol isEqual:NSProtocolFromString(@"NSFunctionBarProvider")] || |
| 447 [protocol isEqual:NSProtocolFromString(@"NSTouchBarProvider")]) { |
| 448 return NO; |
| 449 } |
| 450 return [super conformsToProtocol:protocol]; |
| 451 } |
| 452 |
| 433 - (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds { | 453 - (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds { |
| 434 gfx::Rect checkedBounds = bounds; | 454 gfx::Rect checkedBounds = bounds; |
| 435 | 455 |
| 436 NSSize minSize = [[self window] minSize]; | 456 NSSize minSize = [[self window] minSize]; |
| 437 if (bounds.width() < minSize.width) | 457 if (bounds.width() < minSize.width) |
| 438 checkedBounds.set_width(minSize.width); | 458 checkedBounds.set_width(minSize.width); |
| 439 if (bounds.height() < minSize.height) | 459 if (bounds.height() < minSize.height) |
| 440 checkedBounds.set_height(minSize.height); | 460 checkedBounds.set_height(minSize.height); |
| 441 | 461 |
| 442 return checkedBounds; | 462 return checkedBounds; |
| (...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 | 1994 |
| 1975 - (NSRect)savedRegularWindowFrame { | 1995 - (NSRect)savedRegularWindowFrame { |
| 1976 return savedRegularWindowFrame_; | 1996 return savedRegularWindowFrame_; |
| 1977 } | 1997 } |
| 1978 | 1998 |
| 1979 - (BOOL)isFullscreenTransitionInProgress { | 1999 - (BOOL)isFullscreenTransitionInProgress { |
| 1980 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2000 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
| 1981 } | 2001 } |
| 1982 | 2002 |
| 1983 @end // @implementation BrowserWindowController(WindowType) | 2003 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |