From ad54c1966904ed5b3d7e71c8f6caf4606c7e6a93 Mon Sep 17 00:00:00 2001 From: "viettrungluu@chromium.org" Date: Tue, 9 Mar 2010 15:58:37 +0000 Subject: Mac: incognito badge fixes. 1. Make the incognito badge appear in fullscreen mode. 2. Make the new tab button not run into the incognito badge. BUG=37574, 37745 TEST=Make an incognito window and go to fullscreen mode; incognito badge should be visible in upper right. Make an incognito window with lots of tabs; new tab button (and tabs) shouldn't run into the badge; resize the window and make sure the badge stays in the right place. Review URL: http://codereview.chromium.org/691003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41031 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/browser_window_controller_private.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chrome/browser/cocoa/browser_window_controller_private.mm') diff --git a/chrome/browser/cocoa/browser_window_controller_private.mm b/chrome/browser/cocoa/browser_window_controller_private.mm index e4ab513..5251112 100644 --- a/chrome/browser/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/cocoa/browser_window_controller_private.mm @@ -27,6 +27,9 @@ namespace { +// Space between the incognito badge and the right edge of the window. +const CGFloat kIncognitoBadgeOffset = 4; + // Insets for the location bar, used when the full toolbar is hidden. // TODO(viettrungluu): We can argue about the "correct" insetting; I like the // following best, though arguably 0 inset is better/more correct. @@ -248,6 +251,15 @@ willPositionSheet:(NSWindow*)sheet // this? Moreover, |-layoutTabs| will try to animate.... [tabStripController_ layoutTabs]; + // Now lay out incognito badge together with the tab strip. + if (incognitoBadge_.get()) { + // Actually place the badge *above* |maxY|. + NSPoint origin = NSMakePoint(width - NSWidth([incognitoBadge_ frame]) - + kIncognitoBadgeOffset, maxY); + [incognitoBadge_ setFrameOrigin:origin]; + [incognitoBadge_ setHidden:NO]; // Make sure it's shown. + } + return maxY; } -- cgit v1.1