diff options
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.h | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 5 |
3 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index 3d0d8bd..d5ed7e3 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -166,7 +166,7 @@ void BrowserWindowCocoa::SetStarredState(bool is_starred) { gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const { // Flip coordinates based on the primary screen. NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; - NSRect frame = [window() frame]; + NSRect frame = [controller_ regularWindowFrame]; gfx::Rect bounds(frame.origin.x, 0, frame.size.width, frame.size.height); bounds.set_y([screen frame].size.height - frame.origin.y - frame.size.height); return bounds; diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h index 4a0854b..db0364f 100644 --- a/chrome/browser/cocoa/browser_window_controller.h +++ b/chrome/browser/cocoa/browser_window_controller.h @@ -159,6 +159,11 @@ class TabStripModelObserverBridge; // Make the location bar the first responder, if possible. - (void)focusLocationBar; +// Returns the frame of the regular (non-fullscreened) window (even if the +// window is currently in fullscreen mode). The frame is returned in Cocoa +// coordinates (origin in bottom-left). +- (NSRect)regularWindowFrame; + // Determines whether this controller's window supports a given feature (i.e., // whether a given feature is or can be shown in the window). // TODO(viettrungluu): |feature| is really should be |Browser::Feature|, but I diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index d2c4f19..b086241 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -1470,6 +1470,11 @@ willPositionSheet:(NSWindow*)sheet static_cast<Browser::WindowFeature>(feature)); } +- (NSRect)regularWindowFrame { + return [self isFullscreen] ? [savedRegularWindow_ frame] : + [[self window] frame]; +} + // (Override of |TabWindowController| method.) - (BOOL)hasTabStrip { return [self supportsWindowFeature:Browser::FEATURE_TABSTRIP]; |