summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 17:21:21 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 17:21:21 +0000
commit18fe172980c11836c129b4cdc30e5530c77c10a0 (patch)
tree9cae9b3d110eca2ca2773c4668102356a30f26e9 /chrome/browser/cocoa
parent3c231c59e0a76b0325bcb7285fffeb8c59ad169c (diff)
downloadchromium_src-18fe172980c11836c129b4cdc30e5530c77c10a0.zip
chromium_src-18fe172980c11836c129b4cdc30e5530c77c10a0.tar.gz
chromium_src-18fe172980c11836c129b4cdc30e5530c77c10a0.tar.bz2
[Mac] Modifies GetRestoredBounds() to return the bounds of the hidden regular window when a window is in fullscreen mode.
BUG=31638 TEST=Once fullscreen mode is enabled on trunk, make a window fullscreen, then Cmd-N to open a new window. The new window should be the same size as the original, non-fullscreen window. Review URL: http://codereview.chromium.org/577051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm2
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h5
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm5
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];