summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller_private.mm
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 15:58:37 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 15:58:37 +0000
commitad54c1966904ed5b3d7e71c8f6caf4606c7e6a93 (patch)
tree9d444313041981d7fb10270c452bcc4f9f45c775 /chrome/browser/cocoa/browser_window_controller_private.mm
parent05dfe6a91f4670bfc442b3ab918e5092b3eff6cd (diff)
downloadchromium_src-ad54c1966904ed5b3d7e71c8f6caf4606c7e6a93.zip
chromium_src-ad54c1966904ed5b3d7e71c8f6caf4606c7e6a93.tar.gz
chromium_src-ad54c1966904ed5b3d7e71c8f6caf4606c7e6a93.tar.bz2
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
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller_private.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller_private.mm12
1 files changed, 12 insertions, 0 deletions
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;
}