| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| index 8a26e926bbe3f41c2f25f4452ed50cadff92df26..11b6485b8c278c6ea9ee7723dd62f2a305bc0a3e 100644
|
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| @@ -132,12 +132,11 @@
|
|
|
| BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
|
| BrowserWindowController* controller)
|
| - : browser_(browser),
|
| - controller_(controller),
|
| - initial_show_state_(ui::SHOW_STATE_DEFAULT),
|
| - attention_request_id_(0),
|
| - alert_state_(TabAlertState::NONE),
|
| - window_closed_(false) {
|
| + : browser_(browser),
|
| + controller_(controller),
|
| + initial_show_state_(ui::SHOW_STATE_DEFAULT),
|
| + attention_request_id_(0) {
|
| +
|
| gfx::Rect bounds;
|
| chrome::GetSavedWindowBoundsAndShowState(browser_,
|
| &bounds,
|
| @@ -762,9 +761,10 @@
|
|
|
| web_modal::WebContentsModalDialogHost*
|
| BrowserWindowCocoa::GetWebContentsModalDialogHost() {
|
| - DCHECK(window());
|
| + DCHECK([controller_ window]);
|
| ConstrainedWindowSheetController* sheet_controller =
|
| - [ConstrainedWindowSheetController controllerForParentWindow:window()];
|
| + [ConstrainedWindowSheetController
|
| + controllerForParentWindow:[controller_ window]];
|
| DCHECK(sheet_controller);
|
| return [sheet_controller dialogHost];
|
| }
|
| @@ -792,12 +792,6 @@
|
| }
|
|
|
| NSWindow* BrowserWindowCocoa::window() const {
|
| - // AppKit doesn't seem to guarantee that [controller_ window] returns nil once
|
| - // the NSWindow is destroyed. Since |this| is deleted only once
|
| - // -[NSWindowController dealloc] completes, there's a possibility of
|
| - // a WeakPtr to Browser* requesting the NSWindow, which may be a zombie.
|
| - if (window_closed_)
|
| - return nil;
|
| return [controller_ window];
|
| }
|
|
|
| @@ -847,7 +841,3 @@
|
| callback) {
|
| NOTREACHED() << "The IME warning bubble is unsupported on this platform.";
|
| }
|
| -
|
| -void BrowserWindowCocoa::OnWindowWillClose() {
|
| - window_closed_ = true;
|
| -}
|
|
|