diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 22:02:46 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 22:02:46 +0000 |
commit | bf8651a56e49a121373046d0cd38b19051d1bb0a (patch) | |
tree | d11b01ffb4002137f3a0558dff4412337960f135 | |
parent | 27d8778e09e2dc4cc9b4882c87ac58fd15c81dd9 (diff) | |
download | chromium_src-bf8651a56e49a121373046d0cd38b19051d1bb0a.zip chromium_src-bf8651a56e49a121373046d0cd38b19051d1bb0a.tar.gz chromium_src-bf8651a56e49a121373046d0cd38b19051d1bb0a.tar.bz2 |
Fix regression where status bubble is never shown
My previous change caused the status bubble to never show. The problem was that
I was never making the status bubble window visible in the first place.
BUG=75268
TEST=Verified that the status bubble was visible when mousing over links.
Verified that it was also visible when loading sites.
Ran unit tests. Try jobs pending.
Review URL: http://codereview.chromium.org/6612042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77529 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/cocoa/browser_window_controller_unittest.mm | 14 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/status_bubble_mac.mm | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm index 8ca0617..6a602c7 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm @@ -622,6 +622,14 @@ class BrowserWindowFullScreenControllerTest : public CocoaTest { - (BOOL)supportsFullscreen; @end +// Check if the window is front most or if one of its child windows (such +// as a status bubble) is front most. +static bool IsFrontWindow(NSWindow *window) { + NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; + return [frontmostWindow isEqual:window] || + [[frontmostWindow parentWindow] isEqual:window]; +} + TEST_F(BrowserWindowFullScreenControllerTest, TestFullscreen) { EXPECT_FALSE([controller_ isFullscreen]); [controller_ setFullscreen:YES]; @@ -638,13 +646,11 @@ TEST_F(BrowserWindowFullScreenControllerTest, TestActivate) { EXPECT_FALSE([controller_ isFullscreen]); [controller_ activate]; - NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; - EXPECT_EQ(frontmostWindow, [controller_ window]); + EXPECT_TRUE(IsFrontWindow([controller_ window])); [controller_ setFullscreen:YES]; [controller_ activate]; - frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; - EXPECT_EQ(frontmostWindow, [controller_ createFullscreenWindow]); + EXPECT_TRUE(IsFrontWindow([controller_ createFullscreenWindow])); // We have to cleanup after ourselves by unfullscreening. [controller_ setFullscreen:NO]; diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index aa77c16..45f2c544 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm @@ -391,6 +391,7 @@ void StatusBubbleMac::Create() { void StatusBubbleMac::Attach() { DCHECK(!is_attached()); + [window_ orderFront:nil]; [parent_ addChildWindow:window_ ordered:NSWindowAbove]; [[window_ contentView] setThemeProvider:parent_]; |