| Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
|
| index 92cdfa841099613b49dba258e52ccf2f979a2adb..a837c272ca85142c72570b6e299ae3e5bfc12487 100644
|
| --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
|
| @@ -134,6 +134,13 @@ NSRect GetSheetParentBoundsForParentView(NSView* view) {
|
| selector:@selector(onParentWindowWillClose:)
|
| name:NSWindowWillCloseNotification
|
| object:parentWindow_];
|
| +
|
| + // Observe the parent window's size.
|
| + [[NSNotificationCenter defaultCenter]
|
| + addObserver:self
|
| + selector:@selector(onParentWindowSizeDidChange:)
|
| + name:NSWindowDidResizeNotification
|
| + object:parentWindow_];
|
| }
|
| return self;
|
| }
|
| @@ -169,13 +176,6 @@ NSRect GetSheetParentBoundsForParentView(NSView* view) {
|
| return;
|
| }
|
|
|
| - // Observe the parent window's size.
|
| - [[NSNotificationCenter defaultCenter]
|
| - addObserver:self
|
| - selector:@selector(onParentWindowSizeDidChange:)
|
| - name:NSWindowDidResizeNotification
|
| - object:parentWindow_];
|
| -
|
| // Create an invisible overlay window.
|
| NSRect rect = [self overlayWindowFrameForParentView:parentView];
|
| base::scoped_nsobject<NSWindow> overlayWindow(
|
| @@ -267,10 +267,7 @@ NSRect GetSheetParentBoundsForParentView(NSView* view) {
|
| }
|
|
|
| - (void)onParentWindowWillClose:(NSNotification*)note {
|
| - [[NSNotificationCenter defaultCenter]
|
| - removeObserver:self
|
| - name:NSWindowWillCloseNotification
|
| - object:parentWindow_];
|
| + [[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
| // Close all sheets.
|
| NSArray* sheets = [NSArray arrayWithArray:sheets_];
|
| @@ -292,6 +289,8 @@ NSRect GetSheetParentBoundsForParentView(NSView* view) {
|
| return;
|
|
|
| [self updateSheetPosition:activeView_];
|
| + if (dialogHost_)
|
| + dialogHost_->OnPositionRequiresUpdate();
|
| }
|
|
|
| - (void)updateSheetPosition:(NSView*)parentView {
|
| @@ -350,11 +349,6 @@ NSRect GetSheetParentBoundsForParentView(NSView* view) {
|
| if (![sheets_ containsObject:info])
|
| return;
|
|
|
| - [[NSNotificationCenter defaultCenter]
|
| - removeObserver:self
|
| - name:NSWindowDidResizeNotification
|
| - object:parentWindow_];
|
| -
|
| if ([activeView_ isEqual:[info parentView]])
|
| activeView_.reset();
|
|
|
|
|