summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 18:54:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 18:54:00 +0000
commit0eaf8a477c2cb104d175a13f2c114b4f6462f183 (patch)
tree9d337374a3c70f253d190e853a0dd4d70577b9aa /chrome
parentbdd42287e26666cb9230de0102045ccaa1e29207 (diff)
downloadchromium_src-0eaf8a477c2cb104d175a13f2c114b4f6462f183.zip
chromium_src-0eaf8a477c2cb104d175a13f2c114b4f6462f183.tar.gz
chromium_src-0eaf8a477c2cb104d175a13f2c114b4f6462f183.tar.bz2
The bookmark bar with zero height should be explicitly hidden. This is required for parts of the system not taking visibility into account (e.g. accessibility)
BUG=none TEST=none Review URL: http://codereview.chromium.org/506078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm5
-rw-r--r--chrome/browser/cocoa/browser_window_controller_unittest.mm2
2 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 658b100..ab12bfb 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -1716,8 +1716,11 @@ willPositionSheet:(NSWindow*)sheet
- (CGFloat)layoutBookmarkBarAtMaxY:(CGFloat)maxY width:(CGFloat)width {
NSView* bookmarkBarView = [bookmarkBarController_ view];
- [bookmarkBarView setHidden:NO];
NSRect bookmarkBarFrame = [bookmarkBarView frame];
+ BOOL oldHidden = [bookmarkBarView isHidden];
+ BOOL newHidden = ![self isBookmarkBarVisible];
+ if (oldHidden != newHidden)
+ [bookmarkBarView setHidden:newHidden];
bookmarkBarFrame.origin.y = maxY - NSHeight(bookmarkBarFrame);
bookmarkBarFrame.size.width = width;
[bookmarkBarView setFrame:bookmarkBarFrame];
diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm
index 4c16404..75c7e0e 100644
--- a/chrome/browser/cocoa/browser_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm
@@ -183,8 +183,10 @@ void CheckViewPositions(BrowserWindowController* controller) {
NSRect bookmark = [[controller bookmarkView] frame];
EXPECT_EQ(NSMaxY(infobar), NSMinY(bookmark));
EXPECT_EQ(NSMaxY(bookmark), NSMinY(toolbar));
+ EXPECT_FALSE([[controller bookmarkView] isHidden]);
} else {
EXPECT_EQ(NSMaxY(infobar), NSMinY(toolbar));
+ EXPECT_TRUE([[controller bookmarkView] isHidden]);
}
EXPECT_EQ(NSMaxY(contentView), NSMaxY(toolbar));